How to compare strings in a cell-array and sort them?

조회 수: 2 (최근 30일)
andrea
andrea 2014년 10월 14일
편집: andrea 2014년 10월 14일
These are 2 cell-array, respectively list={'a','b','c','a','e','f','g'}; and list_short={'a','b','c','a'}; that contains the first four elements of 'list'.
I would like to compare the element in 'list_short' and if two of them are equals (like 'a'), change the first of them with the fifth in 'list' and shift the six and seven as five and six and the removed 'a' as seven.
The two cell-array will be: list={'a','b','c','a','f','g','a'}; and list_short={'e','b','c','a'};
Thanks in advance!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by