matlab第四章课后答案.docVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
matlab第四章课后答案

matlab第四章课后答案 %Exercise 1(1) roots([1 1 1]) %Exercise 1(2) roots([3 0 -4 0 2 -1]) %Exercise 1(3) p=zeros(1,24); p([1 17 18 22])=[5 -6 8 -5]; roots(p) %Exercise 1(4) p1=[2 3]; p2=conv(p1, p1); p3=conv(p1, p2); p3(end)=p3(end)-4; %原p3最后一个分量-4 roots(p3) %Exercise 2 fun=inline(x*log(sqrt(x^2-1)+x)-sqrt(x^2-1)-0.5*x); fzero(fun,2) %Exercise 3 fun=inline(x^4-2^x); fplot(fun,[-2 2]);grid on; fzero(fun,-1),fzero(fun,1),fminbnd(fun,0.5,1.5) %Exercise 4 fun=inline(x*sin(1/x),x); fplot(fun, [-0.1 0.1]); x=zeros(1,10);for i=1:10, x(i)=fzero(fun,(i-0.5)*0.01);end; x=[x,-x] %Exercise 5 fun=inline([9*x(1)^2+36*x(2)^2+4*x(3)^2-36;x(1)^2-2*x(2)^2-20*x(3);16*x(1)-x(1)^3-2*x(2)^2-16*x(3)^2],x); [a,b,c]=fsolve(fun,[0 0 0]) %Exercise 6 fun=@(x)[x(1)-0.7*sin(x(1))-0.2*cos(x(2)),x(2)-0.7*cos(x(1))+0.2*sin(x(2))]; [a,b,c]=fsolve(fun,[0.5 0.5]) %Exercise 7 clear; close; t=0:pi/100:2*pi; x1=2+sqrt(5)*cos(t); y1=3-2*x1+sqrt(5)*sin(t); x2=3+sqrt(2)*cos(t); y2=6*sin(t); plot(x1,y1,x2,y2); grid on; %作图发现4个解的大致位置,然后分别求解 y1=fsolve([(x(1)-2)^2+(x(2)-3+2*x(1))^2-5,2*(x(1)-3)^2+(x(2)/3)^2-4],[1.5,2]) y2=fsolve([(x(1)-2)^2+(x(2)-3+2*x(1))^2-5,2*(x(1)-3)^2+(x(2)/3)^2-4],[1.8,-2]) y3=fsolve([(x(1)-2)^2+(x(2)-3+2*x(1))^2-5,2*(x(1)-3)^2+(x(2)/3)^2-4],[3.5,-5]) y4=fsolve([(x(1)-2)^2+(x(2)-3+2*x(1))^2-5,2*(x(1)-3)^2+(x(2)/3)^2-4],[4,-4]) %Exercise 8(1) clear; fun=inline(x.^2.*(x.^2-x-2)); fplot(fun,[-2 2]);grid on; %作图观察 x(1)=-2; x(2)=fminbnd(fun,-1,-0.5); x(4)=fminbnd(fun,1,2); fun2=inline(-x.^2.*(x.^2-x-2)); x(3)=fminbnd(fun2,-0.5,0.5); x(5)=2 feval(fun,x) %答案: 以上x(2)(4)是局部极小,x(1)(3)(5)是局部极大,从最后一句知道x(1)全局最大, x(4)最小。 %Exercise 8(2) clear; fun=inline(3*x.^5-20*x.^3+10); fplot(fun,[-3 3]);grid on;%作图观察 x(1)=-3; x(3)=fminsearch(fun,2.5); fun2=inline(-(3*x.^5-20*x.^3+10)); x(2)=fminsearch(fun2,-2.5); x(4)=3; feval(fun,x) %Exercise 8(3) fun=inline(abs(x^3-x^2-x-2)); fplot(fun,[0 3]);grid on;%作图观察 fminbnd(fun,1.5,2.5) fun2=inline(-abs(x^3-x^2-x-2)); fminbnd(fun2,0.5,1.5) %Exercise 9 close; x=-2:0.1:1;y=-7:0.1:1

文档评论(0)

htfyzc + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档