求救:程序出错,哪位帮忙看一下!急啊
<P>一篇论文里面的程序,关于欠阻尼振动。我重新编了一遍,但是始终运行不了,更出不了图像。不知何故。因为涉及到毕业论文,所以在此求救了。下面是我的程序:<br>wn=10;<br>tf=3;<br>x0=2;<br>v0=1;<br>for j=1:10;<br> z(j)=0.1*j;<br> wd(j)=wn*sqrt(1-z(j)^2);<br> a=sqrt(((wn*x0*z(j)+v0)^2+(x0*wd(j))^2)/wd(j));<br> p(j)=atan(wd(j)*x0/(v0+z(j)*wn*x0));<br> t=0:tf/100:tf;<br> x(j,:)=a*exp(-z(j)*wn*t).*sin(wd(j)*t+p(j));<br>end<br>plot(t,x(1,:),t,x(2,:),t,x(3,:),t,x(4,:),t,x(5,:),t,x(6,:),t,x(7,:),t,x(8,:),t,x(9,:),t,x(10,:))<br>grid,figure,mesh(x)<br>系统报错为<br>??? Error using ==> unknown<br>Subscripted assignment dimension mismatch.</P><P>Error in ==> qznyd at 11<br> x(j,:)=a*exp(-z(j)*wn*t).*sin(wd(j)*t+p(j));<br>请帮忙分析一下<br></P>
[此贴子已经被作者于2006-4-26 12:09:29编辑过]
回复:(zwhy0421)求救:程序出错,哪位帮忙看一下!...
我这里运行没错阿<BR>就出现了一个警告<BR><BR>Warning: Divide by zero.<BR>(Type "warning off MATLAB:divideByZero" to suppress this warning.)
页:
[1]