MATLAB: Matlab coder error

matlab coder

i tried to convert a function from matlab to c. the function,s part accounting for error is:_
>> a=input('code no');
if (a == 1)
disp(' '); >>
the error in code generation report screen reads:-
Expected either a logical, char, int, fi, single, or double. Found a MATLAB type. MATLAB types are returned from calls to the MATLAB interpreter and are not supported inside expressions. They may only be used on the right-hand side of assignments and as arguments to MATLAB calls.
how to avoid such error while convertion.

Best Answer

input() evaluates what the user enters and so could return any arbitrary MATLAB type.
Possibly you might need to input a string and convert the string to a number.