Undoing a strsplit function
이전 댓글 표시
is there a way to reverse the strsplit at the end of a loop?
댓글 수: 3
Scott MacKenzie
2021년 4월 23일
편집: Scott MacKenzie
2021년 4월 23일
What do you mean by "end of a loop"? What loop? If you just want to reverse the order of the elements produced by strsplit, use flip:
>> s = 'a,bc,def,g'
s =
'a,bc,def,g'
>> z = strsplit(s,',')
z =
1×4 cell array
{'a'} {'bc'} {'def'} {'g'}
>> flip(z)
ans =
1×4 cell array
{'g'} {'def'} {'bc'} {'a'}
Walter Roberson
2021년 4월 23일
strjoin()
Edward Jia Sheng Lim
2021년 4월 24일
답변 (1개)
Jan
2021년 4월 23일
0 개 추천
The easiest way is to store a copy of the original data. Then nothing has to be undone.
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!