|
原帖由 bl1983126 于 2008-5-7 20:08 发表
先谢谢大家!二楼的意思是,我在文件a中定义一个global x,那么在文件b中就可以访问x?
global X Y Z defines X, Y, and Z as global in scope. Ordinarily, each MATLAB function, defined by an M-file, has its own local variables, which are separate from those of other functions, and from those of the base workspace. However, if several functions, and possibly the base workspace, all declare a particular name as global, they all share a single copy of that variable. Any assignment to that variable, in any function, is available to all the functions declaring it global. |
评分
-
1
查看全部评分
-
|