Declaring a global variable

1 次查看(过去 30 天)
karthikeyan T
karthikeyan T 2012-2-10
hello guys i need to declare and define a global variable X1 to 0 in a gui callback and i need to use this variable and its value 0 in another callback function.how do i do this.pls help

回答(1 个)

William
William 2012-2-10
global X1 = 0 % use all caps for global
I would advise against using global variables as they can be difficult to debug sometimes. Just my 2 cents

类别

Help CenterFile Exchange 中查找有关 Graphics Objects 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by