How to invert the index of a vector in Simulink?

15 vues (au cours des 30 derniers jours)
Dani Tormo
Dani Tormo le 6 Mai 2013
Commenté : Rafael Cordero le 17 Juin 2020
It is a simple question but I've been looking for a solution without luck!
Let's say I have this vector:
v = [1 2 3]
And I want this:
v = [3 2 1]
Is there any block that makes that?
Thanks!

Réponse acceptée

Kaustubha Govind
Kaustubha Govind le 6 Mai 2013
If you have the DSP System Toolbox installed, you can use the Flip block to flip the vector horizontally. If you don't have access to this toolbox, simply use the MATLAB Function block to call fliplr instead.
  3 commentaires
Dani Tormo
Dani Tormo le 7 Mai 2013
Thank you both!
Rafael Cordero
Rafael Cordero le 17 Juin 2020
This doesn't work for me. I get the input replicated identically at the output - it's not being flipped.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by