필터 지우기
필터 지우기

how can I print out all the variables of my code?

조회 수: 18 (최근 30일)
sadel
sadel 2013년 11월 22일
댓글: Simon 2013년 11월 22일
Hello,
how can I print on my screen all my variables of my code? I'm trying to avoid to use twice the same variables and for that I need to make a list with all my variables. The problem is that I use some m-files which someone else wrote.
Kind regards
  댓글 수: 2
Iain
Iain 2013년 11월 22일
If you're using someone else's m-files, why can't you turn them into functions?
If you turn them into functions, they cannot litter your workspace with random variables.
sadel
sadel 2013년 11월 22일
Hi! These m-files are functions and classes but the problem is that I must modify them or find and fix some errors and for this reason I need all the variables on a list.

댓글을 달려면 로그인하십시오.

채택된 답변

Simon
Simon 2013년 11월 22일
Hi!
Just look at your "Workspace", it can be found in the menu bar. Or type "who" in command window.
  댓글 수: 2
sadel
sadel 2013년 11월 22일
hi and thank you for your answer!
but what if these variables are in a gui program which has many classes? then what can I do?
Simon
Simon 2013년 11월 22일
If you modify a class you modify the functions of tha class. If you are working on a specific function you can set a breakpoint. The execution stops at that point leaving you in debug mode ("K" prompt in command window). Now you can execute "who" and see the variables in the function as defined up to this point.

댓글을 달려면 로그인하십시오.

추가 답변 (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