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

2 views (last 30 days)
if a string s='6,7,8,9,19' how can i convert it as matrix=[6 7 8 9 19]

Accepted Answer

KSSV
KSSV on 24 Oct 2016
Edited: KSSV on 24 Oct 2016
s='6,7,8,9,19' ;
matrix = str2num(s);

More Answers (0)

Categories

Find more on Numeric Types in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!