Debugging the code which is written with global function

1 回表示 (過去 30 日間)
Bathrinath
Bathrinath 2014 年 5 月 8 日
回答済み: Juderb 2014 年 5 月 8 日
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 Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by