Syntax error in every function I wrote at Simulink Fcn block

Hi, I have 7 functions in my simulink model written via Fcn blok. I checked lots of times every function but I couldn't find any misstake. What can be the reason? Thanks!

2 Comments

providing an example would be helpful
thanks Fangjun Jiang this is a function I get syntax error.
(kr*(u(1)+b2*sin(u(3))+a2*sin(u(2))-u(7))+ktr*(u(7)-u(15)))/mr

Sign in to comment.

 Accepted Answer

I tried it. Initially, it had "syntax error". But once I assigned the following variables, the error disappeared. I used a Constant block as the input to the Fcn block. The constant value is rand(15,1). I suspect that you don't have all the below variables assigned. The error message certainly didn't help that much.
kr=1;
b2=1;
a2=1;
ktr=1;
mr=1;

2 Comments

After that, if I run "clear mr", then the "syntax error" comes back. So, I believe that the cause is that you don't have all the needed parameters assigned.
yeah you are right, two parameters were missed:) thank you so much!

Sign in to comment.

More Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Products

Release

R2013a

Community Treasure Hunt

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

Start Hunting!