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

조회 수: 15 (최근 30일)
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.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2010년 1월 21일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by