I wrote a code that replaces non-numeric values in the matrix by some number. Now, to test it I would like to allow MATLAB to accept non-numeric entries.
My code starts with prompt:
matrix_input = input('Please enter the matrix: x=');
If I enter something like [1,2,3;4,5,?], MATLAB gives an error: Unbalanced or unexpected parenthesis or bracket. Since all brackets seem to be balanced, I assume this is due to non-numeric entry. Is it possible to make MATLAB allow non-numeric entries?
NaN
there to replace those non-numeric entries? – Divakarc = {1, 2, 3; 4, 5, '?'}
. From there you can do replacements and get a matrix withm = cell2mat(c)
. – Nras