How to convert a scalar to a vector in Simulink?
Show older comments
I want to convert a scalar, for example 3, to a vector with dimension 3: [0 0 0]
Is posible this?
4 Comments
Ryan G
on 20 Mar 2013
Do you mean you want it to be a vector like:
3
to
[3 3 3];
Or a variable length vector? You can define the size of a vector before you start the simulation but not during. Both methods are possible.
Miguel Montilla-DJesus
on 21 Mar 2013
Ryan G
on 21 Mar 2013
This wouldn't really work with a complicated system for a number of reasons, but if your model is simple you can use a series of enabled subsystems that can be enabled when the proper constant is selected.
Miguel Montilla-DJesus
on 22 Mar 2013
Answers (0)
Categories
Find more on Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!