define 1D array in simulink

I am trying to define a time array to use as an input to an equation in simulink. I tried importing from the workspace but apparently the array needs to have at least two columns. I read that it's possible to define an array in a constant block but my array is going to be very large. any suggestions?

回答 (1 件)

Sebastian Castro
Sebastian Castro 2015 年 4 月 9 日
編集済み: Sebastian Castro 2015 年 4 月 9 日

0 投票

In Simulink, your array should have at least 2 columns -- the first column is always the time, and all subsequent columns are the signal values at the times in the first column.
When dealing with time, you can:
  1. Set the start and stop times, as well as time steps, in the model configuration parameters.
  2. Use a "Clock" block from Simulink > Sources if you need to use the simulation time explicitly in your calculations.
  3. (I guess) if this model will be part of a bigger hierarchy, you want to keep that input port there but use the time as a unit test signal. If so, you could just repeat the time vector as two columns, so that the signal is exactly the time value at all times.
Maybe the above will solve your problem. Or, maybe you need a time vector for something else and I am misunderstanding your question. Why do you want a vector of just time valus?
- Sebastian

カテゴリ

タグ

質問済み:

J
J
2015 年 4 月 8 日

編集済み:

2015 年 4 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by