How to find variable location?

조회 수: 23 (최근 30일)
Muhammad Qaisar Fahim
Muhammad Qaisar Fahim 2022년 6월 4일
답변: eira 2024년 2월 28일
I have one main script file say main_file. When I run this main_file it call several other files where in all those files differnt parameters are defined. After running script my workspace is populated with differnt parameters. I pick one parameter say Accel_30_responce and I want to see its location that in which script this variable is defined. How can I do that? When I right click on the variable and select open selection it takes me to the variables instead of taking me to the the source file. So how can I go to source file ?

답변 (2개)

Voss
Voss 2022년 6월 4일
The way I would go about this is to open "Find Files"
and search for files containing the text "Accel_30_responce".

eira
eira 2024년 2월 28일
In this scenario, to find the source file where a specific variable like "Accel_30_responce" is defined, you can use the following steps:
Look for the variable "Accel_30_responce" in your workspace.
Once you locate the variable, note down its value or any other identifying information.
Search for this variable or its value in all the script files that are being called by your main script file "main_file."
By doing this, you can track down the source file where "Accel_30_responce" is defined and find my location.
This method should help you pinpoint the source file where the variable is defined and determine its location within your script files.

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by