How to convert a scalar to a vector in Simulink?

I want to convert a scalar, for example 3, to a vector with dimension 3: [0 0 0]
Is posible this?

4 Comments

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.
In simulation, I got a scalar number, for example, 2 or 3 (variable value). Can I get (with this value) a vector(variable length) in simulink?
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.

Sign in to comment.

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!