Separate a cell into separate numbers
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Raziur Rahman
am 17 Aug. 2015
Beantwortet: Walter Roberson
am 17 Aug. 2015
I have 4 values in a cell format, like this way "-1,-2,-3.4,-4". I would like to separate this 4 values and use them as 4 different number? How can I do that?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 17 Aug. 2015
If "1,-2,-3.4,-4" indicates a comma separated string, then
numstring = '1,-2,-3.4,-4';
numeric_values = sscanf(numstring,'%f,');
after which it is often best to leave them as an array.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!