Simulink vector to scalar stream

5 次查看(过去 30 天)
yazz.jazz
yazz.jazz 2020-4-21
编辑: bitec bit 2021-4-29
I have a fixed-step (1ms) project. I have a block outputting a 7680x1 vector every 1ms. This output feeds a subsytem that does not accept vector input. Only scalar. So its giving a compile error. What can I do?

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-4-21
See from workspace block: https://www.mathworks.com/help/releases/R2020a/simulink/slref/fromworkspace.html. Create a matrix with two columns in the MATLAB workspace. The first column is the time value, spaces by 0.001 seconds, and the second column is data. This block will read the data, one value at a time.
  5 个评论
Ameer Hamza
Ameer Hamza 2020-4-21
The "from workspace" block serialize the vector to give one value at each time interval. You can change the first column of the input matrix to specify whatever time-sample you want.
bitec bit
bitec bit 2021-4-29
编辑:bitec bit 2021-4-29
hello Ameer!
i have a question here (i am facing this problem), what if the block which doesnt accept the vector is going to be a switch?
Thanks!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 General Applications 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by