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

cdebugdebuggerdebuggingkMATLABselectivesetvaluevariablewatchwatchlist

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.

Best Answer

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.