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

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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

질문:

2013년 5월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by