How to create a time varying constant?
古いコメントを表示
I have data that I logged from my Simulink model using ToWorkspace blocks. This data is in the usual [Time, Data] format and a sample is attached. I have migrated this data into the data dictionary for the model, and now want to use it as input using a Constant block. However, I am getting an error:
Error in port widths or dimensions. Output port 1 of 'Model/Convert' is a one dimensional vector with 334 elements

It seems like it is reading the entire vector at once, instead of one element per time step. Is it possible to have a constant store time varing data? Note, I do not want to read this data into the model using FromWorkspace blocks because these blocks are not supported when using Simulink Design Verifier.
採用された回答
その他の回答 (1 件)
Markus
2021 年 6 月 11 日
0 投票
You could use a counter that counts up and use data as a 2D Lookup-Table.
You can do this with a counter or with the timestamps and attach the clock if you use a fixed timestep.
Either way you would use Data.Data as Table data and either Data.Time as Breakpoints or [1:length(Data)] or length(Data.Data) respectively.
Is this going in the direction you want?
カテゴリ
ヘルプ センター および File Exchange で Get Started with HDL Verifier についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!