save variables in matlab workspace

28 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 12 Nov 2012
Modificato: Azzi Abdelmalek il 12 Nov 2012
value=15;
assignin('base','var',value)
% 'var' is your variable name
  2 Commenti
satendra kumar
satendra kumar il 12 Nov 2012
Thanks Bud :)
Shiv Nileshkumar Matliwala
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.

Accedi per commentare.

Più risposte (1)

Walter Roberson
Walter Roberson il 12 Nov 2012
assignin('base', 'variablename', value)

Categorie

Scopri di più su Workspace Variables and MAT-Files in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by