Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You already got the right idea, I don't know where you got stucked. Here is the code which solves your problem, I tested it, its works fine. Be aware that a simpler input probably gets you better results, that means for example a single step instead of a square wave.</p> <pre><code>% load your data (text file with your two columns) load data.txt; % sample index, reducing of input to get single step instead of square wave x = 1:1:length(data); data(x &gt; 2900,:)=[]; x(x &gt; 2900)=[]; % plot data figure(1) plot(x,data(:,1)); hold on plot(x,data(:,2)); hold off % prepare data for tftest, 100 is a random chosen sampling time tfdata = iddata(data(:,1),data(:,2),100); % estimate system, factor 5 -&gt; number of poles (variable as desired) sys = tfest(tfdata,5); % plot step response (factor 5 comes from input) figure(2) step(5*sys) </code></pre> <p>Edit: the output for number of poles np=5:</p> <pre><code>sys = From input "u1" to output "y1": -3.337e-05 s^4 + 1.326e-07 s^3 + 1.639e-11 s^2 + 1.221e-14 s + 1.064e-19 ---------------------------------------------------------------------------- s^5 + 0.005287 s^4 + 1.516e-06 s^3 + 4.517e-10 s^2 + 2.896e-14 s + 2.037e-19 </code></pre> <p>Edit#2: in your previous question you were asking whether it would be better to use <code>idfrd</code> or <code>iddata</code> - but do you actually have the frequency response data? I actually don't think it should make a big difference, if you choose the number of poles high enough. Just try out what it's working better for you. The workaround is the same.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload