I noticed that assing a string object to a double array, for example,
a=0a(1)="asd"
does not produces an error but sets the value of a(1) to NaN;
This seems inconsistent with assinging an incompatible type like for example a cell array, e.g.
a=0a(1)={'asd'}
—> Conversion to double from cell is not possible.
I would prefer a string assignment to double to also raise an error. Any ideas about why it does not?
Best Answer