Making a Script as a Function... How to see variables in workspace?
Show older comments
Hi,
This has probably been asked before but I can't find the answer. Up until now, I've always just wrote my code in Matlab as a script. Doing this, it's easy to check arrays in the workspace. I'm now doing much more complicated things with Matlab so I'm trying to write "better" code, use more functions etc.
I've started writing using the syntax below. The problem with this is that I can no longer see my variables in the workspace. Is there an easy way to see the variables? I like to look at certain variables to make sure they are doing what I want done, the correct values etc. I also like to type the variables into the command window to look at how the array filled sometimes.
I know that I can add a specific variable to the function output and look at it that way but it's a pain. There has to be a better way!
Thanks,
Cole
% Main code: function My_Script()
stuff here
out = sub_rountine_one(in)
more stuff here
return
% Subroutines:
function [out] = Sub_Routine_One(in) stuff here return
function [out] = Sub_Routine_Two(in) stuff here return
Accepted Answer
More Answers (0)
Categories
Find more on Whos 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!