save variables in matlab workspace

조회 수: 26 (최근 30일)
satendra kumar
satendra kumar 2012년 11월 12일
댓글: Shiv Nileshkumar Matliwala 2022년 12월 15일
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.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 11월 12일
편집: Azzi Abdelmalek 2012년 11월 12일
value=15;
assignin('base','var',value)
% 'var' is your variable name
  댓글 수: 2
satendra kumar
satendra kumar 2012년 11월 12일
Thanks Bud :)
Shiv Nileshkumar Matliwala
Shiv Nileshkumar Matliwala 2022년 12월 15일
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개)

Walter Roberson
Walter Roberson 2012년 11월 12일
assignin('base', 'variablename', value)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by