首页 文章

“来自工作空间”Simulink

提问于
浏览
0

请,我正在模拟一个动态系统,其中一些输入具有数组形式的实际数据,例如1 * 16或存储在Matlab工作空间中的16 * 16维矩阵 . 我已经很长时间尝试使用Simulink中的“From Workspace”块 .

Blockquote

我的模拟时间是1:10时间步长:0.01

Blockquote

My Goal :在模拟过程中按元素显示我的数组或矩阵元素的内容 . enter image description here

非常感谢您提供任何有 Value 的答案 .

1 回答

  • 1

    我没有像你那样手动构建结构,而是建议使用 timeseries 对象 . 它将使您使用正确的数据结构并提供更好的反馈 .

    尝试

    %16 timestamps matching your data size, replace with your time infomration
    time=0:.1:1.5;
    %placeholder for your data
    m=rand(1,16);
    %create timeseries
    ts=timeseries(m,time);
    

    要在MATLAB中验证您的时间序列是否符合您的要求,请使用:

    ts.plot(); %won't output anything useful with random data.
    

    然后在from Workspace块中使用 ts .

相关问题