Effacer les filtres
Effacer les filtres

Switching vector position in a cell array

6 vues (au cours des 30 derniers jours)
HYZ
HYZ le 16 Mai 2020
Commenté : Mehmed Saad le 16 Mai 2020
Hi,
I have a cell array a = {'Susan' 'John'};
May I know if it is possible to switch positions of two vectors at the same time to become a = {'John' 'Susan'}?
For vector, we can write a([1 2]) = a([2 1]); I would like to have something like to apply for cell array. Thank you!
  1 commentaire
Mehmed Saad
Mehmed Saad le 16 Mai 2020
Use the same strategy for cell array
a([2 1])
ans=
{'John'} {'Susan'}
Also read this

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by