版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、习题答案第 1 章1- 2 (1) 使用 windows“ 开始 ” 菜单。(2) 运行 matlab系统启动程序matlab.exe。(3) 利用快捷方式。1- 3 matlab 系统主要由开发环境、matlab 函数库、 matlab 语言、图形功能和应用程序接口五个部分组成。1-4 窗口 :m 文件编辑 / 调试器、历史指令窗、当前目录浏览器、工作空间浏览器、内存数组编辑器、交互界面分类目录窗、及帮助导航/ 浏览器和图形窗。1-5 在操作桌面上选择建立新文件或打开文件操作时,m文件编辑 / 调试器将被启动。在命令窗口中键入edit命令时也可以启动m文件编辑 / 调试器。matlab 的开
2、发环境中包括了专门的m文件编辑器, 该编辑器不但提供了m文件的编辑功能,同时还与matlab 的开发环境一起实现了matlab 命令和函数文件的运行与调试。1-6 copy 将所选历史命令拷贝到剪贴板evaluateselection 运行所选历史命令createm-file 打开编辑器,将所选历史命令复制到编辑器deleteselection 删除所选历史命令( 不确认是否删除) deletetoselection 从头删除到所选历史命令( 不确认是否删除) deleteentirehistory 清除全部历史命令( 将弹出对话框确认是否清除) 1-7 当用户在matlab 命令窗口输入一条
3、命令后,matlab 按照一定次序寻找相关的文件。基本的搜索过程是:(1)检查该命令是不是一个变量。(2) 检查该命令是不是一个内部函数。(3) 检查该命令是否当前目录下的m文件。(4) 检查该命令是否matlab 搜索路径中其他目录下的m文件。用户可以将自己的工作目录列入matlab 搜索路径,从而将用户目录纳入matlab 系统统一管理。设置搜索路径的方法有:(1)用 path 命令设置搜索路径。例如,将用户目录c:mydir加到搜索路径下,可在命令窗口输入命令:2mtalb 7.x 程序设计2 path(path,my )(2) 用对话框设置搜索路径1-8 在 matlab 中有多种获得
4、帮助的途径:(1)帮助浏览器:选择view 菜单中的help 菜单项或选择help 菜单中的matlab help菜单项可以打开帮助浏览器;(2)help 命令:在命令窗口键入help 命令可以列出帮助主题,键入help 函数名可以得到指定函数的在线帮助信息;(3)lookfor命令:在命令窗口键入lookfor 关键词可以搜索出一系列与给定关键词相关的命令和函数;注意: lookfor和模糊查询查到的不是详细信息,通常还需要在确定了具体函数名称后用 help 命令显示详细信息。第 2 章2-1 format short 默认设置,以两位整数和4 位小数形式输出format long 以 16
5、 位十进制数形式输出format short e以 5 位十进制数加指数形式输出format long e 以 16 位十进制数加指数形式输出format short g 从 format short 和 format short e 中自动选择最佳输出形式format long g 从 format long 和 format long e 中自动选择最佳输出形式format hex 以 16 位十六进制数形式输出format + 以正号、负号和零形式输出format bank 以两位小数形式输出format rat 以近似分数形式输出2-2 x=4+8i 3+5i 2-7i 1+4i 7-
6、5i;3+2i 7-6i 9+4i 3-9i 4+4i; rx=real(x) ix=imag(x) ax=abs(x) cx=conj(x) ccx=x 2-3 x=-5:2:5 %建立行向量length(x) %向量 x 的长度x(1) %x的第一个元素习题答案3 3 x(end) % x的最后一个元素x % 向量转置为列向量y=linspace(-5,5,8) %建立行向量y % 向量转置为列向量2-4执行结果为:ans = 3 3 ans = 2 ans = 9 a12 = 1 ah1 = 8 1 6 al1 = 8 3 4 ah1_3 = 8 1 6 4 9 2 al1_3 = 8
7、6 3 7 4 2 a = 8 1 6 0 3 5 7 0 4 9 2 0 0 0 0 9 a = 8 1 6 0 3 5 7 0 4mtalb 7.x 程序设计4 4 9 2 0 a = 8 1 6 3 5 7 4 9 2 2-5执行结果为:ans = 6 ans = 1 5 1 ans = -3 1 5 ans = 7 3 -2 6 -3 5 ans = 6 12 -15 ans = -6 6 6 -12 12 12 -10 10 10 ans = 14 7 12 6 -12 14 10 -19 4 ans = 7 2 3 4 10 12 -9 -3 5 习题答案5 5 ans = 38
8、15 42 -42 29 54 -38 7 22 ans = 49 1 9 4 25 36 9 1 25 ans = 0.0976 0.4634 -0.4146 -0.1707 0.4390 -0.0244 0.5732 -0.9024 0.9390 ans = 0.1429 2.0000 0.3333 1.0000 0.4000 0.3333 -1.0000 -3.0000 0.2000 2-6执行结果为:ans = 1 -2 3 ans = 1 2 3 ans = 1 3 -2 -4 3 5 ans = 1 2 3 3 4 5 ans = 5 6 7 8 ans = 8 6mtalb 7.
9、x 程序设计6 ans = 6 7 8 10 11 12 2-7 已知角度604530 x,求x的正弦、余弦、正切和余切。在三角函数运算中,自变量可以是角度也可以是弧度。x=30 45 60; x1=x/180*pi; sin(x1),cos(x1),tan(x1),cot(x1)% 自变量是弧度sind(x),cosd(x),tand(x),cotd(x) %自变量是角度2-8 x=10:99;length(x(rem(10:99,5)=0) 2-9 x=10:20;log10(x)/log10(3) 2-10 a=1.55 -1.45 1.45 -1.55;floor(a),ceil(a)
10、,round(a),fix(a) 执行结果为:ans = 1 -2 1 -2 ans = 2 -1 2 -1 ans = 2 -1 1 -2 ans = 1 -1 1 -1 2-11 s1=upper(china);s2=china;s3=lower(chinese); c1=strcmp(s1,s2) c2=strcmpi(s1,s2) c3=strncmp(s1,s3,4) c4=strncmpi(s1,s3,2) 执行结果为:c1 = 0 c2 = 1 习题答案7 7 c3 = 0 c4 = 1 2-12执行结果为:ans = 5 5 5 5 ans = -3 -1 1 3 ans =
11、20 ans = 4 6 6 4 ans = 1 8 9 4 ans = 1 4 9 16 ans = 16 8 4 2 ans = 2 4 8 16 16 8 4 2 2-13 执行结果为:ans = 2 h = 2 l = 3 ans = 6 ans = 2x2 double ans = 8mtalb 7.x 程序设计8 1x27 char 2x2 double 2x2 double ans = 2x2 double ans = 2x2 double 2x2 double 3x3 double ans = 0 -3 1 0 ans = 0 ans = -3 ans = 0 1 c = 1x
12、27 char 2x2 double 2x2 double 2x2 double 3x3 double 5 c = 1x27 char 2x2 double 2x2 double 2x2 double 3x3 double 2-14 t.college=computer =wang ming; t.number=19990101; t.sex=man; =matlab; t.corse.class=2004; t.corse(2).name=maple; t.corse(2).class=2005; t2.college=computer =z
13、hang ming; t2.number=19990101; 习题答案9 9 t2.sex=man; =math; t2.corse.class=2006; t2.corse(2).name=matlab; t2.corse(2).class=2005; t2.corse(3).name=math; t2.corse(3).class=2006; t 第 3 章3-1 a=1 5 8;3 0 -4; b=6 -7 3;5 0 2; ab a=b ab a6; %产生与 a同型的 01 逻辑值数组x=find(a6); a(l) % 把 l 中逻辑值1 对应的 a元素取
14、出x %大于 6 的元素在原数组中的序号3-4 执行结果为:x = 0 0 0 0 0 0 0 1 1 y = 1 1 1 1 0 0 0 0 0 l = 1 1 1 1 0 0 0 1 1 al = 1.0000 2.1000 3.2000 4.3000 8.7000 9.8000 xh = 1 2 3 4 8 9 3-5 a=reshape(-6:2:12,2,5); b=reshape(-8:3:19,2,5); la=a&b; lb=a|b; islogical_la=islogical(la) islogical_lb=islogical(lb) any_lab=any(la
15、,lb) all_lab=all(la,lb) 习题答案11 11 执行结果为:islogical_la = 1 islogical_lb = 1 any_lab = 1 1 1 1 1 1 1 1 1 1 all_lab = 1 0 1 1 1 1 1 1 1 1 3-6 a=magic(3);b=magic(4); p1=rem(a,3)=0; p2=rem(b,3)=0; a(p1) b(p2) 3-7 执行结果为:all_a = 1 0 1 1 1 any_a = 1 1 1 1 1 isnan_a = 0 0 0 0 0 0 0 0 0 0 isinf_a = 0 0 0 0 0 0
16、 0 0 0 0 isfinite_a = 1 1 1 1 1 1 1 1 1 1 3-8 a=input(please input a matrix? ); if isreal(a)=1 sign(a) else 12mtalb 7.x 程序设计12 disp(the matrix isnot real matrix) end 3-9x=input( 请输入 x 的值 :); if isreal(x)=0 disp(no defination) elseif x=-1 & x1|x-1 y=1+x else y=x.2+1 end case 0 disp(no defination)
17、 end 3- 10 x=input(please enter x value:); if x=0&x=2&x=3&x10 y=x.2-5*x+6 else y=x.2-x-1 end 3-11 执行结果:习题答案13 13 a = 2 -1 0 0 0 0 -1 2 -1 0 0 0 0 -1 2 -1 0 0 0 0 -1 2 -1 0 0 0 0 -1 2 -1 3-12 s= 108 3-13 程序 1:y=0; for n=1:100 f=1/n/n/n; y=y+f; n=n+1; end y 程序 2:y=0;n=1; while n x4_4(1 -6
18、3 2;3 -5 4 0;-1 -11 2 4) no inverse pinv_a = -0.1000 0.1860 -0.0300 0.5000 -0.2500 -0.2500 0.7000 -0.2020 -0.2900 1.0000 -0.5400 -0.3000 18mtalb 7.x 程序设计18 no det rank_a = 3 x4_4(1 2 1 0;6 2 4 1;0 2 1 0;3 1 4 1) det_a = 1 inv_a = 1.0000 0 -1.0000 0 -3.0000 1.0000 3.0000 -1.0000 6.0000 -2.0000 -5.000
19、0 2.0000 -24.0000 7.0000 20.0000 -6.0000 rank_a = 4 4-5 a=1 1 3 2;-1 1 -1 3;5 -2 8 9;-1 3 1 7;rank(a) ans = 3 线性相关4-6a=2 2 -1;1 -2 4;5 8 2; x,d=eig(a) x = 0.0000 -0.7160 0.2760 -0.4472 0.4200 -0.7472 -0.8944 0.5576 0.6045 d = 6.0000 0 0 0 1.6056 0 0 0 -5.6056 4-7 a=6 5 -2 5;9 -1 4 -1;3 4 2 -2;3 -9 2
20、 0;b=-4 13 1 11; inv(a)*b a=6 5 -2 5;9 -1 4 -1;3 4 2 -2;3 -9 2 0;b=-4 13 1 11; ab ans = -8.3333 2.0000 27.0000 习题答案19 19 18.0000 a=6 5 -2 5;9 -1 4 -1;3 4 2 -2;3 -9 2 0;b=-4 13 1 11;ab=a,b; rref(ab) ans = 1.0000 0 0 0 -8.3333 0 1.0000 0 0 2.0000 0 0 1.0000 0 27.0000 0 0 0 1.0000 18.0000 4-9 x=1 1 3;4
21、 3 2;1 2 5*inv(1 1 -1;2 1 0;1 1 1) x = -1 0 2 0 1 2 -1 -1 4 4-10 p=1 0 -2 -5;r=roots(p); for ii=1:length(r) if r(ii)=0&r(ii)=3 r(ii) end end ans = 2.0946 4-11 (1))(xf、)(xg的根;p1=3 -1 2 1 0 3;p2=1/3 1 -3 -1;roots(p1),roots(p2) ans = 0.7330 + 0.7416i 0.7330 - 0.7416i -0.8952 -0.1188 + 1.0066i -0.11
22、88 - 1.0066i ans = -4.7588 2.0642 20mtalb 7.x 程序设计20 -0.3054 (2))()(xgxf,)()(xgxf和)()(xgxf;p1+0 0 p2 ans = 3.0000 -1.0000 2.3333 2.0000 -3.0000 2.0000 p1 p1 = 3 -1 2 1 0 3 conv(p1,p2) ans = 1.0000 2.6667 -9.3333 2.3333 -4.0000 -4.0000 2.0000 -9.0000 -3.0000 r p k=residue(p1,p2) r = -792.2450 22.1035
23、 -0.8584 p = -4.7588 2.0642 -0.3054 k = 9 -30 177 (3))(xf、)(xg、)()(xgxf的导数。polyder(p1) ans = 15 -4 6 2 0 polyder(p2) ans = 1 2 -3 p q=polyder(p1,p2) p = 2.0000 8.6667 -38.0000 -4.3333 -8.0000 -12.0000 -8.0000 9.0000 q = 习题答案21 21 0.1111 0.6667 -1.0000 -6.6667 7.0000 6.0000 4-12 (1)5,7,9xxx时求( )f x的值
24、。p=3 2 1;polyval(p,5 7 9) ans = -108.9538 -219.0359 -367.1882 (2)2579x时,求( )f x的值。p=3 2 1;polyvalm(p,2 5 ;7 9 ) ans = -181.7691 -251.4115 -351.9761 -533.7452 4-13 p=poly(6 3 8) p = 1 -17 90 -144 roots(p) ans = 8.0000 6.0000 3.0000 4-14 poly(-0.5 -0.3+0.4*i -0.3-0.4*i) ans = 1.0000 1.1000 0.5500 0.12
25、50 4-15 p=4 -12 -14 5 9; diff(p) ans = -16 -2 19 4 p=4 -12 -14 5 9; polyint(p) ans = 0.8000 -3.0000 -4.6667 2.5000 9.0000 0 4-16 22mtalb 7.x 程序设计22 x=0:0.01:1; y=sin(x).*exp(-x/10); interp1(x,y,0.25) ans = 0.2413 4-17 x=1:10;y=log(x)/log(3); interp1(x,y,3.25) ans = 1.0655 4-18 x=-1 2 2.5 3 4;y=0.2 3
26、 3.5 3.6 2.5; f=polyfit(x,y,2) polyval(f,3.5) 4-19 a=1 1 1;polyint(a) quad(x.*log(x),1,exp(1) ans = 2.0973 第 5 章5-1 (1)f=3*x2+5*x+2 表示在给定x 时,将 3*x2+5*x+2的数值运算结果赋值给变量f ,如果没有给定x 则指示错误信息。(2)f=3*x2+5*x+2 表示将字符串 3*x2+5*x+2赋值给字符变量f ,没有任何计算含义,因此也不对字符串中的内容做任何分析。(3)x=sym(x) f=3*x2+5*x+2 表示 x 是一个符号变量, f=3*x2+
27、5*x+2就具有了符号函数的意义,f 也自然成为符号变量了。5-2 syms phi1 phi2; 习题答案23 23 y=simple(sin(phi1)*cos(phi2)-cos(phi1)*sin(phi2) 5-3 syms x; syms y; f=x2+exp(x+y)-y*log(x)-3; subs(f,x,y,2,4) 5-4 syms a11 a12 a21 a22; a=a11,a12,a13;a21,a22,a23;a31,a32,a33 ad=det(a) % 行列式ai=inv(a) % 逆ae=eig(a) % 特征值5-5 (1)求 f,g的反函数和复合函数,
28、(2)分别求f,g的微分,(3)分别求f,g的积分。syms x y t;f=sym(sin(x);g=sym(y/exp(-2*t); finverse(f) finverse(g) finverse(g,t) compose(f,g) compose(f,g,z) diff(f),diff(g,t) int(f) int(g) int(g,t) int(g,t,0, 10) 5-6 syms x; f=x4-5*x3+5*x2+5*x-6; factor(f) horner(f) 5-7 syms x; f=(x+1)3+(x-1)2+5*x-6 24mtalb 7.x 程序设计24 co
29、llect(f,x) 5-8 syms x; expand(x+1)6) 5-9 syms(x,y); n,d=numden(1/(x3-1)+1/(x2+y+1)+1/(x+y+1)+8) 5-10 求下列极限。(1) x=sym(x);limit(1/(x+1)-3/(x3+1),x,-1) (2) x=sym(x);limit(1+cos(x)(3*sec(x),x,pi/2) (3) x=sym(x);limit(log(sin(x)/(pi-2*x)2),x,pi/2) (4) x=sym(x);limit(x2*exp(1/x/x),x,0) (5) x=sym(x);limit(
30、5*x2)/(1-x2)+2(1/x),x,inf) (6) x=sym(x);limit(x2-2*x+1)/(x3-x),x,1) 5-11 求下列幂级数的和函数。(1) n=sym(n);symsum(-1)n*(xn)/sqrt(n*2-n),n,2,inf)(2)n=sym(n);symsum(-1)n*(sin(pi/(2n)*(xn),n,1,inf)(3) n=sym(n);symsum(xn/n,n,1,inf)(4)n=sym(n);symsum(n*xn,n,1,inf) (5)n=sym(n);symsum(-1)n*(xn)/sqrt(n2-n),n,1,inf)(6
31、)n=sym(n);symsum(-1)n*sin(pi*(xn)/(2n),n,1,inf)5-12 求下列函数的导数。(1) x=sym(x);diff(x10+10 x+log(10)/log(x) (2) x=sym(x);subs(diff(1-sqrt(x)/(1+sqrt(x),4)(3)x=sym(x);a=diff(sqrt(x2- 2*x+5) , cos(x2)+2*cos(2*x), 4(sin(x), log(log(x) 5-13 (1) syms t; dx_dt=diff(t4,t); dy_dt=diff(4*t,t); dy_dx=dy_dt/dx_dt (
32、2) 习题答案25 25 syms t; dx_dt=diff(log(1+t2),t); dy_dt=diff(t-atan(t),t); dy_dx=dy_dt/dx_dt 5-14 syms x; dy_dx=diff(exp(x)*cos(x),x,4) 5-15 syms x; syms y; d2y_d2x=diff(exp(x)*sin(x),x,2); dy_dx=diff(exp(x)*sin(x); f=d2y_d2x-2*dy_dx+2*y 5-16 %22xusyms x y; diff(x*log(x+y),x,2) %22yusyms x y; diff(x*log
33、(x+y),y,2) %yxu2syms x y; diff(diff(x*log(x+y),x),y) 5-17 syms a x; f=a, x2, 1/x; exp(a*x), log(x), sin(x); df=diff(f) 5-18 13 syms x;syms a real- y=sqrt(a2-x2),(x-1)/(3*x-1)(1/3),x2*asin(x); int(y,x) 4 syms x;int(x2/(x+1),x) 26mtalb 7.x 程序设计26 5 syms x;int(sin(2*x)/sqrt(1+sin(x)2),x) 6 syms x;int(1
34、/sqrt(x2+5),x) 5-19 计算下列定积分。 (1) syms x;int(x*log(x),1, 2.18) (2) syms x;int(x/sin(x)/sin(x),pi/4,pi/3 ) (3) syms x;int(sin(log(x),-1,2.718 ) (4) syms x;int(x3*(sin(x)2)/(x4+x2+1),-1,1 ) (5)syms x;int(sqrt(sin(x)3-sin(x)5),0,pi ) (6) syms x;int(exp(-x*x/2),0,1 ) 5-20 解下列方程:(1)syms x solve(x5-5*x-1)
35、(2)syms x solve(x*2x-1) (3)syms x solve(x-3*sin(x)-1) (4)syms x syms p q solve(x3+p*x+q,x) 5-21 (1)x=sym(x);y=sym(y);z=sym(z);r=sym(r); s=solve(6*x+5*y-2*z+5*r+4,9*x-y+4*z-r-13,3*x+4*y+2*z-2*r-1,3*x-9*y+2*z-11) s.x s.y s.z s.r (2) x=sym(x);y=sym(y);z=sym(z);r=sym(r); s=solve(2*x+2*y-z+r-4,4*x+3*y-z+
36、2*r-6,8*x+3*y-3*z+4*r-12,3*x+3*y-2*z-2*r-习题答案27 27 6) s.x s.y s.z s.r (3)a=sym(1 -1 1 -1;1 -1 -1 1;1 -1 -2 2); b=sym(1;0;-0.5); x=ab %求一个特解:最少非零元素的最小二乘解syms k; null_a=null(a) m n=size(null(a); for ii=1:n xx=x+k*null_a(:,ii)%构成通解end (4)x=sym(x);y=sym(y);z=sym(z);r=sym(r); s=solve(x-y+4*z-2*r,x-y-z+2*
37、r,3*x+y+7*z-2*r,x-3*y-12*z+6*r) s.x s.y s.z s.r 5-22 1 dsolve(d2y+3*dy+exp(x)=0,x) 2 dsolve(d2y-exp(2*y)*dy=0,x) 5-23 1dsolve(x2-1)*dy+2*x*y-cos(x)=0,y(0)=1,x) 2. dsolve(x2+2*x*y-y2+(y2+2*x*y-x2)*dy=0,y(1)=1,x) 3. syms n;syms v0 dsolve(d2x+2*n*dx+a2*x=0,x(0)=x0,dx(0)=v0,t) 28mtalb 7.x 程序设计28 5-24 (1
38、) 。taylor(x5-x3+2*x+1,-1,7) (2) taylor(x*exp(x),0,6) 第 6 章6- 1 x=-2:0.01:2;plot(x.2.*sin(x.2-x-2) fplot(x.2*sin(x.2-x-2),-2 2) ezplot(x.2*sin(x.2-x-2),-2,2) 6- 2 subplot(2,2,1);ezplot(cos(x),0,2*pi) subplot(2,2,2);ezplot(sin(x-pi/2),0,2*pi) subplot(2,2,3);ezplot(x2)*cos(x-pi),0,2*pi) subplot(2,2,4);
39、ezplot(exp(sin(x),0,2*pi) 6- 3(1)syms x;syms y; y=1+log(x+2); g=finverse(y); x=-2:0.001:2; y=subs(y,x); plot(x,y) hold on; g=subs(g,y); plot(y,g)(2)syms x;syms y; y=(x2+1)(1/3); g=finverse(y); x=-2:0.001:2; y=subs(y,x); plot(x,y) hold on; g=subs(g,y); 习题答案29 29 plot(y,g) 6-4 (1) syms x; f=1/(x+1)-3/
40、(x3+1); y=limit(f,x,-1) ezplot(f); hold on; vy=double(y) plot(-1,vy,r.) (2)syms x; f=(1+2*x)(1/x); y=limit(f,x,0); ezplot(f); hold on; vy=double(y); plot(0,vy,r.) 6-5 x=-10:0.01:10; y=2*exp(-0.5*x); %y=2*a(-0.5*x) %y=abs(sin(x) %y=sin(abs(x) %y=2*sin(3*x) plot(x,y) figure subplot(2,2,1);bar(x,y,g) s
41、ubplot(2,2,2);fill(x,y,r) subplot(2,2,3);stairs(x,y,b) subplot(2,2,4);stem(x,y,k) 6-6 syms x; f=x2+x+1; g=log(x); 30mtalb 7.x 程序设计30 fg=compose(f,g) gf=compose(g,f) x=10:0.1:20; plot(x,subs(fg,x),x,subs(gf,x) 6-7 x = 0:0.1:10; y = 2*x.3 +10*x.2+5*x+6; figure(1) subplot(2,2,1) plot(x,y); title (linea
42、r plot); xlabel (x); ylabel (y); grid on; subplot(2,2,2) semilogx(x,y); title (semilog x plot); xlabel (x); ylabel (y); grid on; subplot(2,2,3) semilogy(x,y); title (semilog y plot); xlabel (x); ylabel (y); grid on; subplot(2,2,4) loglog(x,y); title (loglog plot); xlabel (x); ylabel (y); grid on; 6-
43、8 (1)t=-1:0.001:1;plot(t.4,4*t) (2)t=-10:0.001:10;plot(log(1+t.2),t-atan(t) 习题答案31 31 6-9 syms x;syms y; f=y2-x;g=y-x2; x,y=solve(f,g,x,y); x=x(1):0.001:x(2); plot(x,sqrt(x),x,x.2) s=int(sqrt(x)-x.2,x(1),x(2) 6-10 % 只画实部t=0:pi/20:4*pi; y=log(t.2+1).*cos(t)+i*sin(2*t); subplot(2,2,1),plot(t,y); title
44、(plot of complex function vs time); xlabel(t); ylabel(y(t); % 实部与虚部分别画t=0:pi/20:4*pi; y=log(t.2+1).*cos(t)+i*sin(2*t); subplot(2,2,2),plot(t,real(y),b-); hold on; plot(t,imag(y),r-); title(plot of complex function vs time); xlabel(t); ylabel(y(t) legend(real,imaginary); hold off; % 同时画实部与虚部t=0:pi/20
45、:4*pi; y=log(t.2+1).*cos(t)+i*sin(2*t); subplot(2,2,3),plot(y,b-); title(plot of complex function ); xlabel(freal part); ylabel(imagainary part); % 极坐标t=0:pi/20:4*pi; 32mtalb 7.x 程序设计32 y=log(t.2+1).*cos(t)+i*sin(2*t); subplot(2,2,4),polar(angle(y),abs(y); title(plot of complex function ); 6-11 thet
46、a=-2*pi:0.01:2*pi;polar(theta,sin(theta) 6-12 t=-2*pi:0.01:2*pi;plot3(exp(-0.2*t).*cos(2*t),exp(-0.2*t).*sin(2*t),t) 6-13% 三维曲线x=-1:0.01:1;y=x; z=sin(pi*sqrt(x.2+y.2); plot3(x,y,z) % 三维网格x=-1:0.01:1;y=x; x,y=meshgrid(x,y); z=sin(pi*sqrt(x.2+y.2); mesh(x,y,z) % 三维网面x=-1:0.01:1;y=x; x,y=meshgrid(x,y); z=sin(p
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 苗木培育工安全专项能力考核试卷含答案
- 售票值班员岗前客户服务考核试卷含答案
- 清扫工道德水平考核试卷含答案
- 干酪素点制工保密竞赛考核试卷含答案
- 2026年危重患者护理安全隐患课件
- 磁头研磨工岗前基础常识考核试卷含答案
- 电工发展趋势模拟考核试卷含答案
- 流行饰品制作工安全宣传考核试卷含答案
- 紧固件制造工安全演练测试考核试卷含答案
- 耳机与人耳配置测试工安全强化评优考核试卷含答案
- 2026年开学第一课法治教育课件
- 2026年重庆市从“五方面人员”中选拔乡镇领导班子成员考试试卷(含完整答案解析)
- GB/T 8334-2026液化石油气和液化二甲醚钢瓶定期检验与评定
- 建筑工程管理专业中级职称理论考试题及答案(2026年)
- 2025电梯安全管理员考试试题及答案
- 2026年排污许可证自行监测试题(含答案)
- 2026年贵州省中考数学试题【含答案】
- GA/T 1999.3-2025道路交通事故车辆速度鉴定方法第3部分:基于视频图像
- 地理试卷江苏南京市六校联合体2025-2026学年2026届高三上学期8月学情调研测试(8.27-8.29)
- 职业技术学校兽医临床诊疗技术教案
- 2型糖尿病综合管理专家共识课件
评论
0/150
提交评论