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

2 visualizaciones (últimos 30 días)
Roman Foell
Roman Foell el 25 de Oct. de 2021
Comentada: Roman Foell el 25 de Oct. de 2021
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.

Respuestas (1)

KSSV
KSSV el 25 de Oct. de 2021
You can convert double into integer using int32 ot int64.
  1 comentario
Roman Foell
Roman Foell el 25 de Oct. de 2021
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.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by