Matlab cell2mat error: all contents of the input cell array must be of the same data type -
I'm trying to apply the cell2mat function to a cell with a string that is empty or integer I get this error That the contents of the cell are not the same data type, even when I run "iscellstr" on an index with an empty string and an index with an integer sting, returned both 1, to the right. What else can be caused by this error?
Try to use instead of cell 2 mat.
You have empty cells Example: Notice is empty cells and empty string. but [] instead of the empty string
'' .
& gt; & Gt; ; M = {'123'; ''; []; '-2'} M = '123' '' [2]
Cell2 matte increases this error:
& gt; & Gt; All the contents of the error input cell array using cell2 matte (M) cell2 matte (line 46) should be of the same data type.
str2double returns:
& gt; & Gt; Str2double (M) ans = 123NNNN-2
Comments
Post a Comment