Converting of the return values of a min function for code generation
1 view (last 30 days)
Show older comments
I have a problem with the return datatype of a MATLAB built-in min function. For example there is a matrix A(3,3,3) with values of datatype 'single'. If I use the min function, like this:
[I, K] = min(A)
I'll receive vector "I" with values with datatype 'single' and vector "K" with indices with datatype 'double'. For code generation I do not use doubles, so I need only single or integers. If I cast the vectors to int or single, the embedded coder reduce with part of the code, so it does not appear in the generated coe and there are still operations with doubles. How can I resolve the problem with return datatypes of the min function? Type casting seems not to resolve the problem.
Thanks a lot!
Best regards,
Daniel.
0 Comments
Answers (1)
See Also
Categories
Find more on Operators and Elementary Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!