is there any way to list the variables used in the particular .m file?

5 ビュー (過去 30 日間)
tina jain
tina jain 2015 年 4 月 5 日
編集済み: Stephen23 2015 年 4 月 5 日
as for list folder and directories we use ls. There is any command for variables list in a paricular program.

回答 (2 件)

Star Strider
Star Strider 2015 年 4 月 5 日
If the file is open and has been run at least once, the whos function will list all the variables in the script’s workspace.

Stephen23
Stephen23 2015 年 4 月 5 日
編集済み: Stephen23 2015 年 4 月 5 日
You can use whos to list variables in a workspace, after a script or function has run. Just keep in mind the difference between scripts and functions:
  • scripts share the base workspace, so it is not possible to know which script or command-line operation has created or changed any variable.
  • functions each have their own workspace.
Also note that:
  • using clear removes variables from a workspace
  • assing assignin and eval can make variables appear in other workspaces, without any indication of this in their own script?function code. This is one reason why it is a bad idea to use these commands.

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT Files についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by