[讨论] 一个简单的问题

楼主: peterchen33 (peterchen33)   2014-11-16 23:50:34
各位大大好
小弟目前做一个报告 想用MATLAB跑图
于是试着key参数 如下
>> r=0.02;,R=0.05;,L=0.3;,p=1000;,g=9.8;
>> x=linspace(0,0.5*pi,100);
>> A=(r*cos(x) / R).^4;
>> M=pi*p*R^2*sqrt(L) * sqrt(1-A) / sqrt(4*g*cos(x)*A);
??? Error using ==> mtimes
Inner matrix dimensions must agree.
有想说是不是x和A作为矩阵 前面要加一个.
试过了还是不行
还是说A跟x不能同时并用?
麻烦版上各位高明过目
作者: rtj (Anonymity)   2014-11-17 00:07:00
建议最后一段程式: for i=1:100M(i)=pi*p*R^2*sqrt(L)*sqrt(1-A(i))/sqrt(4*g*cos(x(i))*A(i))end (上一行末加分号)
楼主: peterchen33 (peterchen33)   2014-11-17 15:40:00
十分感谢

Links booklink

Contact Us: admin [ a t ] ucptt.com