Short Matlab script that takes an array (i.e. vector) of numbers and returns cell with fileds that are string representation of the numbers in the array.For example:
>> a=[1 2 3.24 -43 4.56];
>> numarray2cellstring(a)
ans =
'1' '2' '3.24' '-43' '4.56'
It's better to use regexp(arrayOfStringNumbers, '\s*', 'split'). This avoids for loops.
ReplyDeleteThank you very much :)
ReplyDeleteI couldn't find any other way to make this command work!
set(gca,'XTickLabel',numarray2cellstring(indexes))
it works only with a cell with strings inside.
Thanks again