Switching vector position in a cell array

2 ビュー (過去 30 日間)
HYZ
HYZ 2020 年 5 月 16 日
コメント済み: Mehmed Saad 2020 年 5 月 16 日
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 件のコメント
Mehmed Saad
Mehmed Saad 2020 年 5 月 16 日
Use the same strategy for cell array
a([2 1])
ans=
{'John'} {'Susan'}
Also read this

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeFeature Detection and Extraction についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by