×
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

Exporting Variable to Workspace and calling it in the same Simulation.

Exporting Variable to Workspace and calling it in the same Simulation.

Exporting Variable to Workspace and calling it in the same Simulation.

(OP)
Hello Everyone!!!
 
I'm simulating a control strategie for an hydraulic system using Symulink. The control strategy uses the values of a variable in t-1 and compares it with the value on t. Until now I've been using the MEMORY block in order to get the value of t-1, whick works well if I test the control strategy alone (no with the hydraulic system). When I combine the control strategy and the hydraulic system Simulink cannot handle this loop and I get the error:
 
Embedded MATLAB Interface Error: 'modell3_129/Konrollstrategie Skyhook/Embedded MATLAB Function/ SFunction ' cannot use 'set default dimension function'
 
Thats why I need to find another way to do this.
 
I thought I could export the value of "t" to the workspace and then just call it in the next time step. I tried using the block "TO WORKSPACE" to export it and "FROM WORKSPACE" to import the results.
The problem is that the values are exported as array (or matrix) just at the end of the simulation. That means that in t+1 I cant import the values and compare.
 
Does any one know a way to export the values of a variable in "t" and then import them in t+1 ?
 
I'm working also with embeded matlab functions in SImlulink, so a solution via Matlab fcn or Simulink blocks would be perfect.
 
Thank you very much!
 
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