save variables in matlab workspace

I have a function which calls a script. There are some variables in script. I want to save them to my command window. How can i do that. Any help fellas.

 采纳的回答

value=15;
assignin('base','var',value)
% 'var' is your variable name

2 个评论

Is there any way to load the variable directly to base workspace ? becuase Its not possible to do this
assignin('base','var')
I want to do like above.

请先登录,再进行评论。

更多回答(1 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Environment and Settings 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by