Info

This question is closed. Reopen it to edit or answer.

Simulink HDL code generation for custom matlab functions

1 view (last 30 days)
Hello,
I am trying to generate HDL code for a custom Matlab function I have in Simulink. I am just trying to learn how things work basically so my "custom" function block is very simple;
function y = my_function(u, k)
y = atan2(u, k);
end
However, when I try to generate an HDL code for this function I get the following error, "Block 'test/Subsystem/MATLAB Function' is unsupported for HDL code generation when in native floating-point mode". When I just use atan2 block from Simulink I can generate HDL code perfectly fine but when I try my own custom function block I get this error. Simulink simulation works though, I get proper outputs from my scopes.
How can I fix this? Do I have to use separate floating point libraries or am I missing something else?
Thanks in advance.

Answers (0)

Community Treasure Hunt

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

Start Hunting!