Link error when using MATLAB function block in simulink with linear algebra functions and breakpoint

1 view (last 30 days)
I'm trying to run a simple MATLAB function block in Simulink like below. In the MATLAB function block I have a simple linear algebra command,
function y = fcn(u)
%#codegen
bla = 10;
y = rank(u);
It compiles and runs just fine as this. However, if I put a breakpoint in the function so that I can debug, it outputs the following link error.
### Linking ...
link.exe /nologo /dll /MANIFEST /OPT:NOREF /export:mexFunction /OUT:testLinearAlgebraFunction_sfun.mexw64 /map:"testLinearAlgebraFunction_sfun.map" @testLinearAlgebraFunction_sfun.mol
LINK : fatal error LNK1181: cannot open input file 'Files\MATLAB\R2016a\extern\lib\win64\microsoft.obj'
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\link.exe"' : return code '0x49d'
Stop.
However. if I get rid of the 'rank' function. I am able to set a breakpoint in the function.
From the error meesage, it really just seems like a parsing issue where 'Program Files' are cutoff but I cannot find any easy way to modify the makefile. Thoughts? MATLAB Version is R2016a
  1 Comment
Sulaymon Eshkabilov
Sulaymon Eshkabilov on 9 May 2020
Should you use Simulink? Otherwise, Matlab solves all LA problems with over dozens of different ways more efficiently than Simulink blocks.
If you're trying to work with the function flie of MATLAB function block, then it is a different story.
This function file works w.r.t your inserted commands unless there is a illegal operations enforced with a step size, for instance.

Sign in to comment.

Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!