Simple Question on Simulink to generate an array of values

3 次查看(过去 30 天)
Hello Everyone ,
I feel that its really a dumb question to be even posted on forums. but i couldn't figure out the solution for simple problem which i am facing.
The Problem is I need to generate an array of values say [1:20] (or) [1:45] (or) [1:n] (or) even zeros(1,n) ,so this n varies for every time step (using discrete mode simulation)...
How would I get these values on simulink ???
  1 个评论
Sam McDonald
Sam McDonald 2017-3-8
Do you mean the array varies in size for each time step? If so, what are you trying to do?
If you are simply wanting to generate an array of values that stays constant for each time step, then you can use a Constant block.
From the documentation page for the Constant block:
The Constant block generates a real or complex constant value.
The block generates scalar, vector, or matrix output, depending on:
  • The dimensionality of the Constant value parameter
  • The setting of the Interpret vector parameters as 1-D parameter
The output of the block has the same dimensions and elements as the Constant value parameter. If you specify for this parameter a vector that you want the block to interpret as a vector, select the Interpret vector parameters as 1-D parameter. Otherwise, if you specify a vector for the Constant value parameter, the block treats that vector as a matrix.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by