필터 지우기
필터 지우기

Switching vector position in a cell array

조회 수: 6 (최근 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 CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by