How to create an array in simulink?
10 次查看(过去 30 天)
显示 更早的评论
Hello! I would like to create an array with zero values, but i would like to define the array size from external port. So the array would be variable-size. I shouldn't use any MATLAB function. Maybe it would be a proper solution, if I could save the size as a global variable, and I could define the array in a Constant block. Is it possible? Or somebody has any idea for the solution of this problem? Thanks!
0 个评论
回答(1 个)
ES
2017-4-20
You can have a workspace variable say
A=5;
and use
zeros(1,A)
as the value in constant block.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!