MATLAB coder input type definition problem

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

 채택된 답변

Walter Roberson
Walter Roberson 2018년 1월 30일

0 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

질문:

2018년 1월 30일

댓글:

2018년 1월 31일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by