Filter löschen
Filter löschen

Add strings with a loop

3 Ansichten (letzte 30 Tage)
Philipp Mueller
Philipp Mueller am 15 Mai 2020
Bearbeitet: KSSV am 15 Mai 2020
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.

Akzeptierte Antwort

KSSV
KSSV am 15 Mai 2020
Bearbeitet: KSSV am 15 Mai 2020
Name =cell(numRows) ;
for j=1:numRows;
Name{j}=Test.Measure(j, 1).name
end
iwant = unique(Name)

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by