How to fit data!
2 ビュー (過去 30 日間)
古いコメントを表示
I have experimental data and I need to represent it as a function of x using the MATLAB fitting tool.
However, the obtained experimental data were non-linear and were fitted by dividing the intervals.
The problem here is that the fitting is made so that the function values at the points connecting the sections do not match.
Is there a way or code to fix and fit the end value of the interval?
A data example is attached.
It's a long question, but I'll wait for an answer. Thank you.
(If there is an efficient way to represent it as a function, please let me know!)
- There may be some awkward parts using a translator! :)
4 件のコメント
Image Analyst
2022 年 1 月 26 日
You said "A data example is attached." but there is no attachment. Use the paperclip icon to attach your file, and give us the code to read it in and plot it.
採用された回答
Star Strider
2022 年 1 月 25 日
This is something similar to Curve Fitting of large Data Measurement? however with a different sort of envelope. I would begin by using the envelope function to get the general shape of the envelope, derive a function that describes it mathematically in terms of the other data (time, amplitude, frequency, perhaps others), then change the code in the Answer I linked to in order to fit the entire function to the data (unless the desired result is only to determine a function for the envelope, if so stop after the envelope determination step).
2 件のコメント
Star Strider
2022 年 1 月 27 日
It ocurred to me that this could be a straighttforward system identification problem, and would automatically code for the envelope function as well, since that may not be possible to correctly estimate otherwise.
For best results, I need to know what the inputs were to the system that produced those outputs. It should be a vector (or matrix) of corresponding sample times. The system identification is not going to work well without knowing the inputs.
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/874645/h2_f_og_.csv', 'VariableNamingRule','preserve')
x = T1.x;
Fx = T1.Fx;
Ts = mean(diff(x)) % Sampling Interval
% Tsd = std(diff(x)) % Check Sampling Time Consistency
Fx_data = iddata(Fx,[],Ts)
Fxss_sys = ssest(Fx_data, 8)
figure
compare(Fx_data, Fxss_sys)
.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!