声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2200|回复: 5

[综合讨论] 急求??? Error using ==> mtimes Inner matrix dimensions must agree.

[复制链接]
发表于 2009-9-26 09:15 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
function shuipingyidong
c=13;m=3.1;q=0.89;a=8;h=304;
v1=0.92;r=159;b=0.27;
w0=m*q*1000*cosd(a);
t1=30/0.92;
t(1)=60/360;
p1=1-exp(-c.*t(1));
p2=1-exp(-c.*(t(1)-t/360));
x=-200:20:500;
u1=b*w0*(p1*(exp(-pi*x.^2/r.^2)-exp(-pi*(x-v1*t1).^2/r.^2))+...
    p2*(exp(-pi*(x-v1*t1).^2/r.^2)-exp(-pi*(x-2*v1*t1).^2/r.^2)));
t(2)=120/360;
p1=1-exp(-c.*t(2));
p2=1-exp(-c.*(t(2)-t/360));
p3=1-exp(-c.*(t(2)-2*t/360));
p4=1-exp(-c.*(t(2)-3*t/360));
x=-200:20:500;
u2=b.*w0.*(p1.*(exp(-pi.*x.^2./r.^2)-exp(-pi.*(x-v1.*t1).^2./r.^2))+...
    p2*(exp(-pi.*(x-v1*t1).^2/r.^2)-exp(-pi.*(x-2.*v1.*t1).^2/r.^2))+...
    p3*(exp(-pi.*(x-2*v1*t1).^2/r.^2)-exp(-pi.*(x-3.*v1.*t1).^2/r.^2))+...
    p4*(exp(-pi.*(x-3*v1*t1).^2/r.^2)-exp(-pi.*(x-4.*v1.*t1).^2/r.^2)));
figure;
plot(x,u1,'-ro',x,u2,'--mx');
xlabel('→工作面开采方向/m');
ylabel('水平移动值U/mm');
grid on
运行结果错误如下

??? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> shuipingyidong at 18
u2=b.*w0.*(p1.*(exp(-pi.*x.^2./r.^2)-exp(-pi.*(x-v1.*t1).^2./r.^2))+...
回复
分享到:

使用道具 举报

发表于 2009-9-26 12:43 | 显示全部楼层

回复 楼主 shicaixia 的帖子

Ref
常见的程序出错问题整理 (eight) 5F
http://forum.vibunion.com/forum/thread-46001-1-1.html
 楼主| 发表于 2009-9-26 15:48 | 显示全部楼层
换是没解决
你能指出具体错的地方吗

[ 本帖最后由 ChaChing 于 2009-9-26 16:36 编辑 ]
发表于 2009-9-26 16:36 | 显示全部楼层
u2=b.*w0.*(p1.*(exp(-pi.*x.^2./r.^2)-exp(-pi.*(x-v1.*t1).^2./r.^2))+...
    p2*(exp(-pi.*(x-v1*t1).^2/r.^2)-exp(-pi.*(x-2.*v1.*t1).^2/r.^2))+...
    p3*(exp(-pi.*(x-2*v1*t1).^2/r.^2)-exp(-pi.*(x-3.*v1.*t1).^2/r.^2))+...
    p4*(exp(-pi.*(x-3*v1*t1).^2/r.^2)-exp(-pi.*(x-4.*v1.*t1).^2/r.^2)));

p2/p3/p4皆为1*2, 而後面的表示式皆为1*36, 请问怎麽点乘!? :@)
已非编程问题了, 建议楼主检查下计算流程!

[ 本帖最后由 ChaChing 于 2009-9-26 16:47 编辑 ]

评分

1

查看全部评分

 楼主| 发表于 2009-9-27 09:54 | 显示全部楼层
已经解决了,谢谢各位
发表于 2009-9-27 16:27 | 显示全部楼层

回复 5楼 shicaixia 的帖子

建议楼主解决问题后回帖分享你的经验和心得
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 05:30 , Processed in 0.059435 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表