how to convert a string to an array of numbers? in example :
str='1,2,3,4.5' to number=[1 2 3 4.5].
I wrote the code below, but it has a problem.
str='1,2,3,4.5';
tmp = regexp (str,',','split');
tmp2=[];
for(i=1:length(tmp))
tmp2(i)=cell2mat(tmp(i))
end