Sample Time in From Workspace Block
4 ビュー (過去 30 日間)
古いコメントを表示
Hello, I have some model that uses temperature data collected for one year. If I use as an input a sinusoidal signal, my output follows the correct model, but, if I put my data signal it does not follow the model. I think that the problem is that my input signal (data and time) has a total length of 9000, but if I try to plot it, it is using just 300 aprox. Is there any way to use the sample time exact that is in my data?
Thank you.
0 件のコメント
回答 (1 件)
Sameer
2025 年 5 月 6 日
Hi @Carlos
To make Simulink use the exact sample times from your data with the "From Workspace" block:
1. Format your data as a two-column matrix:The first column is time, the second is your signal.
codedata = [time_vector, signal_vector];
2. Set the From Workspace block’s "Sample time" to -1:This tells Simulink to use the time values from your data instead of a fixed sample time.
3. Set the simulation Start and Stop times to match the range of your time data (e.g., Start time = time_vector(1), Stop time = time_vector(end)).
This way, Simulink will use all your data points at the exact times you have in your file.
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!