Matlab Function Block compilation errors with variable-step solver and try and catch

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 Commento

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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su MATLAB Coder in Centro assistenza e File Exchange

Richiesto:

il 23 Mag 2013

Community Treasure Hunt

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

Start Hunting!

Translated by