I have C= 5×1 cell array. need to convert it to a numeric matrix. I am executing the following 3 commands and attaching their outputs. what I need is output of E but with the size same as C. struggling for a couple of hours now.
D=str2double(C)
E=cell2mat(C)
F=str2num(C)
C =
5×1 cell array {[ 25]} {[ 35]} {[ 40]} {[ 35]} {0×0 double}
D =
NaN NaN NaN NaN NaN
E =
25 35 40 35
Error using str2num (line 31) Requires character vector or array input.
>> whos C D E F Name Size Bytes Class Attributes
C 5x1 488 cell D 5x1 40 double E 4x1 32 double
Best Answer