How do I stop matlab automatically converting a normal variable into a global variable that I defined previously but deleted.
Mostrar comentarios más antiguos
I am having a strange problem. I had defines a variable as global variable with name 'mog'. Steps are following,(1)I ran the code/function with global variable definitions.(2)I then deleted the lines in my code where the global variable was defined.(3)I then cleared the global variable using 'clear global' and/or 'clearvars -global mog' as well (According to me, i do not need to do this probably because if i deleted the definition of the global variable it should not exist in my work space)(4)Then I closed and restated matlab. (5)Then I started writing a new function and defined a normal variable with name 'mog', but matlab for some reason makes it a global variable automatically... And I do not understand why? And how can I stop this variable 'mog' to be automatically converted into a global variable.
Respuesta aceptada
Más respuestas (1)
Anuj Anand
el 17 de En. de 2014
0 votos
Categorías
Más información sobre Workspace Variables and MAT Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!