×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Simulink not recognizing output variable....

Simulink not recognizing output variable....

Simulink not recognizing output variable....

(OP)
Hello all,

As you can tell from my signature, I'm very new here, so please be patient.

I have a Simulink model of a HVAC fan controller with multiple plants/controllers in the system. The s-functions are templates found in Simulink's library. One controller in particular is intended to output a 7-element vector to a dmux. When I attempt to run the simulation, Simulink gives an error that "Output returned by S-function "...." in "...." during flag=3 call must be a real vector of length 7."

Doing a bit of digging - the vector length is fine, but it believes one variable is NaN. If I remove the variable from the output string, the simulation runs fine (not accurately, but it runs). If I allow the variable to output to the workspace (by removing a semi-colon) - the variable has a value. No doubt about it. If I shorten the simulation run time, and check the variable values at start-up, it still gives a positive, real number.

Some people have mentioned using a structure on it - which I attempted, but was stopped by Matlab, which stated I could not use a structure on a double.

I'm at my wits end - any ideas?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources