×
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

Global Variables and Embeded Matlab Functions

Global Variables and Embeded Matlab Functions

Global Variables and Embeded Matlab Functions

(OP)
Hello...
I working in Simulink with a Matlab Embeded Function and I need to export the values of the variable "A" to the Workspace DURING the simulation.

I tried using a "TO WORKSPACE" block, but the results of the "A" are are sent to the workspace only at the end of the simulation. What I need is sone function that'll send the results DURING the simulation. After a time step is calculated the results should be exported. That means that "A" should be exportet permanently as a scalar and rewriten in every step. The problem is that the embeded matlab function does not support Global Variables.

The reason for this is that in this embeded Matlab function (function 1) I calculate a value which I need to send to another function 2. That means, function 1 exports the value for "A" at time=t. In the next step the function 2 takes the value and send a signal to a valve (open/close).

Is there a way to export a variable globally to the workspace during the simulation in embeded matlab functions?

Thank you in advance

claudio

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