How to rotate a vector

4 vues (au cours des 30 derniers jours)
Guendouz walid
Guendouz walid le 23 Jan 2023
Commenté : Guendouz walid le 23 Jan 2023
Hello ! I wonder if anyone has an elegant way to rotate a vector to create symmetry for Example:
[110 120 130 140 150 160 180]
to
[180 160 150 140 130 120 110]
Thanks in advance!
Walid

Réponse acceptée

Askic V
Askic V le 23 Jan 2023
Déplacé(e) : Fangjun Jiang le 23 Jan 2023
If you want to reverse elements, then just use flip function.
v = 1:10
v = 1×10
1 2 3 4 5 6 7 8 9 10
v_f = flip(v)
v_f = 1×10
10 9 8 7 6 5 4 3 2 1
  1 commentaire
Guendouz walid
Guendouz walid le 23 Jan 2023
thank you very much.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interactions, Camera Views, and Lighting dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by