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 commentaires

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?
Ryan G
Ryan G le 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.
Thank you

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Simulink dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by