Importing Continuous data into Simulink from Matlab Workspace
2 views (last 30 days)
Show older comments
Does anyone have direction or help on how I can continuously import values from the Matlab workspace into Simulink? They can be in array format or structure. The values are variables and as they are updated, the values in Simulink must update as well??
Thanks
2 Comments
Accepted Answer
Guy Rouleau
on 9 Mar 2011
Based on the description, it looks like you should write a C/C++ s-function that would interface with your HID dll properly, whithout going through the MATLAB workspace.
If you really need to "communicate" with the MATLAB workspace, I would use a Level-2 MATLAB S-function, you will be able to use any MATLAB command. But this will definitely be less robust than creating a proper interface to your dll in C/C++.
0 Comments
More Answers (1)
Paulo Silva
on 8 Mar 2011
Try with the Matlab fcn block, if the variable is just a number you just need to put the name of the variable, if it's something else be careful and insert the proper code in order for the output of the fcn block be just what you want.
2 Comments
Kaustubha Govind
on 8 Mar 2011
If you are using an Embedded MATLAB block, you can use the eml.extrinsic directive to call unsupported functions. If you are indeed using a MATLAB Fcn block, can you post the error message that you see on calling into the DLL?
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!