Debugging the code which is written with global function

1 次查看(过去 30 天)
I am trying to modify the code in which code is written by declaring global, and all functions are in the same page. If I am trying to debug, in the workspace it is not showing the data. After debugging it is showing 'unassigned'.How to debug this.I have to modify some data. Give some points

回答(1 个)

Juderb
Juderb 2014-5-8
Your question is vague. Within your code, what is declared global? Is the variable declared global in ALL functions you wish to use it in, using the same exact name?
Also, the global variable persists only as long as it is a live-variable in at least one function. If you declare a variable global in a function, and that function ends, the variable will be de-allocated. Attempting to declare the same variable global in another function will result in creating an empty "double" value.

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by