MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   全局变量 (https://www.labfans.com/bbs/showthread.php?t=5145)

呆呆 2008-11-04 11:10

全局变量
 
用函数定义的局部变量计算出来的值,如何转换为全局变量啊?
function t=ENU(cs,cp,p)
global E NU
G=cs^2*p;
NU=(2*cs^2-cp^2)/(2*cs^2-2*cp^2)
lamda=cp^2*p-2*G;
E=G*(3*lamda+2*G)/(lamda+G)
end



>> ENU(cs1,cp1,p1)

NU =

0.2500


E =

6.2499e+008

>> E
??? Undefined function or variable 'E'.


所有时间均为北京时间。现在的时间是 11:01

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.