Plotting with experimental data
5 次查看(过去 30 天)
显示 更早的评论
Hi, I have 3 columns, time(in s), output(in V), input(in V) respectively, where by using iddata, is it correct for me to determine the ['Frequency',time] in seconds ? or should i do it in frequency (Hz)
tf = iddata(data(:,2),data(:,3),'Frequency',time)
sys = tfest(tf,2)
By using the system identification app, after importing the output and input values and estimation using state space model it turns that that the order is 2. Is it right for to to key in [tfest(tf,2)] in this case ? Or doing it wrongly?
Any help is appreciated !
采纳的回答
Star Strider
2017-2-3
I would use this syntax (from the documentation):
- data = iddata(y,u,Ts) creates an iddata object containing a time-domain output signal y and input signal u, respectively. Ts specifies the sample time of the experimental data.
Specifically with respect to your data, I would do something like this:
time = data(:,1);
Ts = mean(diff(time));
time_data = iddata(data(:,2),data(:,3),Ts);
freq_data = fft(time_data);
freq_units = freq_data.units;
Fr = freq_data.frequency;
sys = tfest(freq_data,2)
NOTE — I do not have your data so this is UNTESTED CODE. I cannot be certain it will work without modification.
更多回答(1 个)
Walter Roberson
2017-2-3
The 'Frequency' parameter should have frequencies. If you have sample times then pass them as the third parameter with no 'Frequency' option; https://www.mathworks.com/help/ident/ref/iddata.html
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Transfer Function Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!