how to convert a string contains number seperated by commas into a matrix of numbers

1 Ansicht (letzte 30 Tage)
if a string s='6,7,8,9,19' how can i convert it as matrix=[6 7 8 9 19]

Akzeptierte Antwort

KSSV
KSSV am 24 Okt. 2016
Bearbeitet: KSSV am 24 Okt. 2016
s='6,7,8,9,19' ;
matrix = str2num(s);

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Conversion 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