how to see a variable of a function in the Workspace?
Show older comments
How to see a variable of a function in the Workspace?
4 Comments
Azzi Abdelmalek
on 14 Aug 2016
What varibles? what functions? post an example
Rightia Rollmann
on 14 Aug 2016
Azzi Abdelmalek
on 14 Aug 2016
function out_1 = test( in_1 )
global internal
out_1 = in_1 + 1;
internal = [ 1 2 ];
Save this function as test.m then in Matlab Windows command type
global internal
in_1=10 % set a value to in_1
out_1 = test( in_1 )
internal
@Rightia Rollmann: rather than learning bad programming practices (using globals), you should simply learn to use the debugging tools, or passing variables properly.
Accepted Answer
More Answers (0)
Categories
Find more on Variables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!