MATLAB: How to convert a string contains number seperated by commas into a matrix of numbers

matrix

if a string s='6,7,8,9,19' how can i convert it as matrix=[6 7 8 9 19]

Best Answer

s='6,7,8,9,19' ;
matrix = str2num(s);