- The dimensionality of the Constant value parameter
- The setting of the Interpret vector parameters as 1-D parameter
Simple Question on Simulink to generate an array of values
2 次查看(过去 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
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.
The Constant block generates a real or complex constant value.
The block generates scalar, vector, or matrix output, depending on:
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 Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!