Output of [~,IDX] = max(...) not in DOUBLE but in INT.

6 次查看(过去 30 天)
Hi together,
I want to output the index of the maximum value of max() not in double, but in int.
Is there an easy way to do this?
Because of interest, I want to generate C Code, thats why int format would be more efficent.
Thanks for your answer.

回答(1 个)

KSSV
KSSV 2021-10-25
You can convert double into integer using int32 ot int64.
  1 个评论
Roman Foell
Roman Foell 2021-10-25
Thanks, I know, but I do not want get an output as double and then transform it to int. I want to define it from the beginning as int.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by