Switching vector position in a cell array

3 visualizaciones (últimos 30 días)
HYZ
HYZ el 16 de Mayo de 2020
Comentada: Mehmed Saad el 16 de Mayo de 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 comentario
Mehmed Saad
Mehmed Saad el 16 de Mayo de 2020
Use the same strategy for cell array
a([2 1])
ans=
{'John'} {'Susan'}
Also read this

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by