How to use set_param correctly in a function
5 views (last 30 days)
Show older comments
A on 1 Sep 2021
Commented: Walter Roberson on 6 Sep 2021
When I execute the following program in a function, each process can be performed, but the data in the To workspace is not reflected in the base workspace.
What is the difference between this and script execution?
Also, is there a way to solve this problem?
Walter Roberson on 1 Sep 2021
The To Workspace block typically writes data to the MATLAB® base workspace. For a sim command in a MATLAB function, the To Workspace block sends data to the workspace of the calling function, not to the MATLAB base workspace. To send the logged data to the base workspace, use an assignin command in the function.
More Answers (0)
Find more on Model, Block, and Port Callbacks 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!