I have following cell array of strings:
daycell =
'd100'
'd104'
'd105'
I would like to make an array of numbers from it like this:
array =
100 104 105
I can accomplish it using loop:
daycell = {'d100';'d104';'d105'}
array = [];
for g = 1:1:length(daycell)
array(g) = str2double(daycell{g}(2:end));
end
Is is possible to do it without loop? Is is even better using it without loop? The daycell has much more rows in real.
So far I am able to eliminate the d letter using:
daym = cell2mat(daycell);
daynoD = daym(:,2:end);
daynoD =
100
104
105
but I do not know what to do with the matrix of characters.
str2num(daynoD).str2numandstr2double!