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

1 件のコメント

Joe Ted
Joe Ted 2018 年 1 月 31 日
That's it ! Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB 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