Matrix dimensions must agree 出错求助
错误为:??? Error using ==> mrdivide
Matrix dimensions must agree.
Error in ==> mymean at 13
f(1)=(R0/2*sqrt(C0/L0)+G0/2*sqrt(L0/C0))*(1-1/(8*omga1^2)*(R0/L0-G0/C0)^2)-gbeta1;
出错函数为:
function f=mymean(x)
global omga1 omga2 gbeta1 galpha1 gbeta2 galpha2
R0=x(1);G0=x(2);C0=x(3);L0=x(4);
f(1)=(R0/2*sqrt(C0/L0)+G0/2*sqrt(L0/C0))*(1-1/(8*omga1^2)*(R0/L0-G0/C0)^2)-gbeta1;
f(2)=omga1*sqrt(L0*C0)*(1+1/(8*omga1^2)*(R0/L0-G0/C0)^2)-galpha1;
f(3)=(R0/2*sqrt(C0/L0)+G0/2*sqrt(L0/C0))*(1-1/(8*omga2^2)*(R0/L0-G0/C0)^2)-gbeta2;
f(4)=omga2*sqrt(L0*C0)*(1+1/(8*omga2^2)*(R0/L0-G0/C0)^2)-galpha2;
请大家帮忙看下哈,函数里并没有矩阵啊,为什么出错消息是维数不一致啊
[ 本帖最后由 eight 于 2008-1-30 20:31 编辑 ] 原帖由 wenzicao 于 2008-1-30 16:44 发表 http://www.chinavib.com/forum/images/common/back.gif
错误为:
??? Error using ==> mrdivide
Matrix dimensions must agree.
Error in ==> mymean at 13
f(1)=(R0/2*sqrt(C0/L0)+G0/2*sqrt(L0/C0))*(1-1/(8*omga1^2)*(R0/L0-G0/C0)^2)-gbeta1;
出错函数为:
...
除法运算时有误。按照置顶贴中的出错问题整理帖、结合出错提示和“写给学习matlab的新手们”这个精华贴,自己断点调试一下即可
[ 本帖最后由 eight 于 2008-1-30 20:32 编辑 ]
页:
[1]