资源描述:
《控制系统的matlab仿真与设计(王海英)前9章习题答案》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、第二章:2.1x=[15223394857760]x(6)x([135])x(4:end)x(find(x>70))2.2T=[1-23-42-3];n=length(T);TT=T';fork=n-1:-1:0B(:,n-k)=TT.^k;endBtest=vander(T)2.3A=zeros(2,5);A(:)=-4:5L=abs(A)>3islogical(L)X=A(L)2.4A=[4,15,-45,10,6;56,0,17,-45,0]find(A>=10&A<=20)2.5p1=conv([1
2、,0,2],conv([1,4],[1,1]));p2=[1011];[q,r]=deconv(p1,p2);cq='商多项式为';cr='余多项式为';disp([cq,poly2str(q,'s')]),disp([cr,poly2str(r,'s')])2.6A=[111213;141516;171819];PA=poly(A)PPA=poly2str(PA,'s')第三章:3.1n=(-10:10)';y=abs(n);plot(n,y,'r.','MarkerSize',20)axisequalg
3、ridonxlabel('n')3.2x=0:pi/100:2*pi;y=2*exp(-0.5*x).*sin(2*pi*x);plot(x,y),gridon;3.3t=0:pi/50:2*pi;x=8*cos(t);y=4*sqrt(2)*sin(t);z=-4*sqrt(2)*sin(t);plot3(x,y,z,'p');title('Linein3-DSpace');text(0,0,0,'origin');xlabel('X'),ylable('Y'),zlable('Z');grid;3.4t
4、heta=0:0.01:2*pi;rho=sin(2*theta).*cos(2*theta);polar(theta,rho,'k');3.5[x,y,z]=sphere(20);z1=z;z1(:,1:4)=NaN;c1=ones(size(z1));surf(3*x,3*y,3*z1,c1);holdonz2=z;c2=2*ones(size(z2));c2(:,1:4)=3*ones(size(c2(:,1:4)));surf(1.5*x,1.5*y,1.5*z2,c2);colormap([0,1
5、,0;0.5,0,0;1,0,0]);gridonholdoff第四章:1.factor:functionf=factor(n)ifn<=1f=1;elsef=factor(n-1)*n;end2.fcircle:function[s,p]=fcircle(r)s=pi*r*r;p=2*pi*r;3.jcsum1:functionk=jcsum1(n)k=0;i=0;whilei<=nk=k+2^i;i=i+1;end4.jcsum:functionk=jcsum(n)k=0;fori=0:nk=k+2^i
6、;end4.1form=100:999m1=fix(m/100);m2=rem(fix(m/10),10);m3=rem(m,10);ifm==m1*m1*m1+m2*m2*m2+m3*m3*m3disp(m)endend4.2[s,p]=fcircle(10)4.3y=0;n=100;fori=1:ny=y+1/i/i;endy4.4s=0;fori=1:5s=s+factor(i);ends第五章:1.fxyz:functionf=fxyz(u)x=u(1);y=u(2);z=u(3);f=x+y.^2
7、./x/4+z.^2./y+2./z;5.1A=[2,1,-5,1;1,-5,0,7;0,2,1,-1;1,6,-1,-4];b=[13,-9,6,0]';x=Ab5.2[U,fmin]=fminsearch('fxyz',[0.5,0.5,0.5])5.3X=linspace(0,2*pi,50);Y=sin(X);P=polyfit(X,Y,3)AX=linspace(0,2*pi,50);Y=sin(X);Y1=polyval(P,X)plot(X,Y,':O',X,Y1,'-*')5.4x=0:2
8、.5:10;h=[0:30:60]';T=[95,14,0,0,0;88,48,32,12,6;67,64,54,48,41];xi=[0:0.5:10];hi=[0:10:60]';temps=interp2(x,h,T,xi,hi,'cubic');mesh(xi,hi,temps);第六章:6.1symsxy=finverse(1/tan(x))6.2symsxyf=1/(1+x^2);g=sin(y);f