Is there a way to display the values of all variables in my workspace while debugging MATLAB code?

49 views (last 30 days)
I would like the ability to display the values of all variables in workspace while I am debugging my code. Currently, I am able to hover my mouse over a variable name to display its value, but I would like to be able to display the values of all variables in a list.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Jan 2010
The ability to display an entire list of variable values when debugging is not available in MATLAB. To work around this issue, create a file with code similar to the following:
myvals = whos;
for n = 1:length(myvals)
myvals(n).name
eval(myvals(n).name)
end
This script can be called from the "K>>" prompt when debugging MATLAB files to list the values of variables in the base workspace.

More Answers (0)

Categories

Find more on Data Import and Export in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!