How can I import the value of the Matlab simulink to the default workspace?
2 次查看(过去 30 天)
显示 更早的评论
How can I import the value of the Matlab simullink to the basic workspace?
0 个评论
回答(1 个)
Angelo Yeo
2025-4-18
To export values in different workspace to base workspace, you can use assignin. An example is below.
function foo
n = 123;
assignin('base','baseWorkSpaceVar',n);
end
As a result, a variable called "baseWorkSpaceVar" will be saved in your base workspace with the same value as "n" in the function "foo".
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!