필터 지우기
필터 지우기

Add strings with a loop

조회 수: 3 (최근 30일)
Philipp Mueller
Philipp Mueller 2020년 5월 15일
편집: KSSV 2020년 5월 15일
Hello,
I know its a simple question:
I have a loop.The reult (Name) of the loop is a string.
for j=1:numRows;
Name=Test.Measure(j, 1).name
end
I want this output:
Name = {'x100',
'x187',
'x122',
'x187'};
One additional question if i have a second time or third time the same string like x187 in my result how can i delete the second or third time?
Thank you.

채택된 답변

KSSV
KSSV 2020년 5월 15일
편집: KSSV 2020년 5월 15일
Name =cell(numRows) ;
for j=1:numRows;
Name{j}=Test.Measure(j, 1).name
end
iwant = unique(Name)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by