MATLAB: MATLAB coder input type definition problem

matlab code generator

Hi.I'm using MATLAB coder for generating C code. For starting I tried a test.
function energy = code_raw_1(x)
y = max(x);
energy =y;
end
I want input type as uint16 but as I defined it, this error came up !!!
Incorrect class for expression 'x': expected 'uint16' but found 'double'.
I don't know why but it seems i have to define input as double.Any bright ideas?Thanks

Best Answer

Your code_raw_1Test needs to uint16() whatever input value you are passing to code_raw_1
Related Question