How can I import the value of the Matlab simulink to the default workspace?

1 回表示 (過去 30 日間)
채린
채린 2025 年 4 月 17 日
回答済み: Angelo Yeo 2025 年 4 月 18 日
How can I import the value of the Matlab simullink to the basic workspace?

回答 (1 件)

Angelo Yeo
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".

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by