Matlab Function Block compilation errors with variable-step solver and try and catch
Show older comments
Hi,
I'm looking to create a function block in Matlab because it seems like a quick alternative. I wrote code that works when put in the MatLab Command Window (quite simple code in fact). Though when I compiled it, I got an error saying it cannot be used with a variable-step solver (using grt.tlc compiler). I changed my compiler for rsim.tlc as suggested, but then I get this weird "Try and catch are not suppoert for code generation" error on line 1, column 1, "fun" ....
which is :
function dI = fcn(Tensions, Time, RotationSpeed)
%#codegen
...
All my function does is creating a small matrix using inputs and workspace variables and inversing the created matrix.
Also know that I must use variable-step solver.
Thanks a lot!
Jessy
1 Comment
Kaustubha Govind
on 23 May 2013
Are you using try/catch in your function? Also, what functions do you use to create the matrix and invert it? Make sure that you are only using functions supported for code generation.
Answers (0)
Categories
Find more on MATLAB Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!