24小时热门版块排行榜    

查看: 236  |  回复: 1

hpuwyb

新虫 (小有名气)

[求助] 错误出在哪里了?

>> a=5.0;L=10.0;B=10.0;
rho=1000.0;gra=9.81;W=100000.0;
ratio=L/a;
theta=linspace(0.0,pi/2.0);
VoverVw=cos(theta)+0.5*ratio*cos(theta).*(theta);
options=optimset('display','off');
figure(1)
subplot(1,2,1)
plot(theta*180/pi,VoverVw,'k')
axis([0.0,90.0,0.0,1.5])
ylabel('V/V_w')
xlabel('/theta(degrees)')
grid on
hold on
MaxTheta=inline('1-(cos(theta)+0.5*ratio*cos(theta).*sin(theta))','theta','ratio');
ThetaMaxDeg=fzero(MaxTheta,[0.01,pi/2.0],options,ratio)*180/pi;
plot(ThetaMaxDeg,1.0,'sk')
text(19,0.95,['\theta_{max}=',num2str(ThetaMaxDeg,4)'\'circ'])
ThetaMax Vol=fiminbnd(MaxTheta,0.0,ThetaMaxDeg*pi/180,options,ratio);
MaxVol=1-MaxTheta(ThetaMaxVol,ratio);
plot(ThetaMaxVol*180.0/pi,MaxVol,'ks')
text(10,MaxVol+0.1,['max vol='num2str(MaxVol,4)])
text(10,MaxVol+0.05,['at\theta='num2str(ThetaMaxVol*180/pi,4)'\circ'])
subplot(1,2,2)
theta=linspace(0.01,ThetamaxDeg*pi/180);
h=zeros(1,length(theta));
for i=1:length(theta)
r=roots([tan(theta(i))*0.5,a,-a*L]);
h(i)=r(2);
end
plot(theta*180/pi,h)
ylabel('h(meters)')
xlabel('\theta(degrees)')
grid on
figure(2)
Frod=((B*rho*grav*h.^3)./(6*cos(theta).^2)+0.5*W*L*sin(theta))./(L*sin(theta+acos(cos(theta)/sqrt(2))));
plot(theta*180.0/pi,Frod*le-6
ylabel('F_{rod}(MN)')
xlabel('\theta(degrees)')
grid on
Matrix dimensions must agree.(运行后所显示的)怎么来解决啊???
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xiegangmai

版主 (职业作家)

我没头衔

优秀版主优秀版主优秀版主

【答案】应助回帖

★ ★ ★ ★
感谢参与,应助指数 +1
hpuwyb: 金币+2 2013-05-10 10:41:04
ben_ladeng: 金币+2, 谢谢交流 2013-05-11 17:21:11
楼主是在出题考大家吗?
第18行应为:
text(19,0.95,['\theta_{max}=', num2str(ThetaMaxDeg,4),'\circ'])

第19行:
ThetaMax Vol是神马东东,中间加个空格表示什么?
fiminbnd是什么,自定义的函数?是fminbnd吧?

第23行:
text(10,MaxVol+0.05,[num2str(ThetaMaxVol*180/pi,4),'\circ'])

第36行:
grav是神马东东?

[ Last edited by xiegangmai on 2013-5-9 at 22:50 ]
明德厚学、求是创新
2楼2013-05-09 22:42:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 hpuwyb 的主题更新
信息提示
请填处理意见