Debugging the code which is written with global function

1 view (last 30 days)
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

Answers (1)

Juderb
Juderb on 8 May 2014
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.

Categories

Find more on Data Types in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!