Debugging the code which is written with global function

1 visualización (últimos 30 días)
Bathrinath
Bathrinath el 8 de Mayo de 2014
Respondida: Juderb el 8 de Mayo de 2014
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

Respuestas (1)

Juderb
Juderb el 8 de Mayo de 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.

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by