matlab - Getting variable out in workspace from function -


when running function, not variables out in work-space. when set breakpoints able variables in workspace. therefore, how variables out in workspace without setting breakpoint?

you can use

assignin('base','variablename',value); 

to write variables function-workspace base-workspace.
when use breakpoints see workspace of function or script execution stopped at. can choose in editor workspace(stack) want see in debug mode.
if want write whole function-workspace base-workspace (which in sense of encapsulation not recommended) can use

vars=whos; k=1:length(vars)    assignin('base', vars(k).name, eval(vars(k).name)); end  

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -