Matlab Compiler SDK chooses wrong overloaded MATLAB function
Show older comments
So I run into a runtime error when using a .NET library compiled witch MATLAB Compiler SDK.
Basically my MATLAB function is calling angle(sys) with frd data (Frequency Response Data) at some point. This works fine when calling my function in MATLAB.
However, when compiling to a .NET library and running the same function from C# with same data I get following error:
"Undefined function 'atan2' for input arguments of type 'frd'. Error in angle (line 13)"
I already narrowed it down to following problem: instead of calling function
sys = angle(sys)
which is specified for frd data, it calls
p = angle(h)
Both instances of angle are regular MATLAB functions, not written by myself. The second one can't handle frd data though, while the first one processes frd data and wraps around the second one.
I do already know a few workarounds for this. I could write a function with a unique name
angle_frd
mimicing the quite basic funciton of
sys = angle(sys)
But I would rather be interested in understanding how this problem comes about and if there is any way to declare which overloaded function to call for the MATLAB Compiler, or if it is possible to make clear to the compiler that I call angle with frd data.
Any help is welcome. Thank you.
Answers (0)
Categories
Find more on MATLAB Compiler SDK 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!