版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、workl1-1command window» 12+2*(7-4)/3*2ansa»i 11 5 sdect data to name valuemb ans22command window» 12+2*(7-4)/3*2ansxworkwi。,xej? select data to .name *valuem日ans22田,0.63450.(2» s=l-l/2+l/3-l/4+l/5-l/6+l/7-l/8: » scommand history: 押 x2015/11/25 9:04 % 12+2*(7-4)/3'2 s=l-l
2、/2*l/3-l/4+l/5-l/6-»0. 6345a»1- 3command window» yl=2*sin(0. 3*pi)/(l+sqrt(5)0. 5000a»tp select data to . name valuemb ans2 2bs0.63450.syi0.50000.!<>command history岭 ,xcommand history 3 x©%- 2015/11/25 9:04 % 12+2*(7-4)/3"21-412+2*(7-4)/3"2s=l-l/21/3-l/4+l/5-
3、l/'(-syl=2sinz0. 3pi/(1+sqrt( yl=2*sin0. 3pi/(l+sqrt yl=2*sin(0. 3*pi)/(1+s:kclcyl=2*sin(0. 3*pi)/(l+sq vvaluem220.63450.(0.50000.;0.36330.:command window? x» yl=2*sin(0. 3*pi)/(1+sqrt (5)0. 5000» y2=2*cos(0. 3*pi)/ (1+sqrt (5)0. 3633a»<>command history? xs=1-1/2+1/3-1/4+1/5
4、-1/|asyl=2sin0. 3pi/(lsqrt(yl=2*sin'o. 3pi/(l*sqrt yl=2*sin(0. 3*pi)/(l+s.clcyl=2*sin(0. 3*pi)/(hsq y2=2*cos(0. 3*pi)/(hsq v<>work22- 1command windowxworkspace? x pvp (a到戸j 松各select data to. valuemin max<8x8 double00.9706ans =0.63450.6345 0.63450.50000.5000 0.50000.363303633 0.36331000
5、00100 00010 00001 00000 1<command history>x» rand (8)ayl=2*sin0. 3pi/(l-sqrtans =yl=2*sin(0.3*pi)/(l+s-clccolumnsi through 7yl=2*sin(0.3*pi)/(l+sq:|v2=2*cos(0. 3*pi)/(l+sq:0.81470.95750.42180.67870.27690.43870. 7094eye (5)0.90580.96490.91570.75770.04620.38160. 7547rand(8)0.12700.15760. 79
6、220. 74310. 09710. 76550.2760tri 1 (ans)v0.91340.97060.95950.39220.82350. 79520.6797v<>2-1- (1)command windowxworkspace? xawj ytq sdect data to » tril(ans)valueminmax<8x8 double>00.97060.63450.6345 0.63450.50000.5000 0.5000ans -0.36330.3633 0.3633columns 1through 70.81470000000. 905
7、80. 9649000000. 12700. 15760. 79220000<>command historyx0.91340. 97060. 95950. 3922000a0. 63240. 95720. 65570. 65550. 694800yl=2*sinl0. 3pi/(l*sqrt0. 09750. 48540. 03570. 17120.31710. 48980yl=2*sin:(0. 3*pi)/(1+s.0. 27850. 80030. 84910. 70600. 95020. 44560. 1190clc0. 54690. 14190. 93400. 03180
8、. 03440. 64630. 4984yl=2*sin(0. 3*pi)/(hsq:y2=2*cos (0. 3*pi)/(卜sqcolumn 8eye(5)rand (8)0tril(ans)vfx0v<>2-2command window» x=l:2:29; » x(:)ans =workspace-i ? x113? select datato”. valueminmax<1x15 double129<15x1 double1290.6j450.63450.63450.50000.50000.50000.36330.36330.3633&l
9、t;>command history,o f x13579111315171921232527a 292-3clcyl=2*sin(0. 3*pi)/(l+sq y2=2*cos (0. 3*pi) / (l-sq. eyerand(8)tril(ans)x=l:2:29;x(:)command window口声 x» a=diag(x)aa =columns1 through111000000000003000000000005000000000007000000000009000000000001100000000000130000000000015000000000001
10、700000000000190000000000021000000000000a o0000000000q0q0000jworkspace-xselect data to . valueminmax<15x15 double,029<1x15 double >129<15x1 double >1290.63450.63450.6345<1x1 $ym>0.50000.50000.50000.36330.36330.3633<>command history口,xeye(5)arand(8)tril(ans)x=l:2:29;x(:)a=di
11、ag(x)syms x;h a=diag(x)a=diag(x)vx=l:2:29-x(:)a=diag(x) syms x; a=diag(x) a=diag(x) size (a, l)2-3command window-? xworkspacex0000 a0? select data to -0000namevaluem0000ba<15x15 double0bx<1x15 double*100003 ans-n1515bs0.6345o.0000ex<1x1 sym>0000byi0.50000.s3y203633oj000000002300002500<
12、;>00270command history*' nxbrand (8)atri 1 (ans)00029» size (a, 1)ans15a»ovr2-4command window? xworkspace? x» b=rand(size(a)a回ri甸益囑1select data to namevaluemb =田a<15x15 double >0丑b<15x15 double>0.(田x<1x15 double>1bans1515columns 1 through 7田,0.63450.(byiby2<
13、;1x1 sym>0.50000.36330.!0. 89090.47330.93400. 74820. 81730.14500.49090.95930. 35170.12990.45050. 86870.85300.48930. 54720.83080. 56880. 08380. 08440. 62210. 33770.13860. 58530. 46940.22900. 39980.35100.9001<>0.14930. 54970.01190.91330. 25990. 51320. 3692command history口 ?xtril(ans)a0. 25750
14、.91720. 33710.15240. 80010. 40180.1112x=l:2:29;0.84070. 28580.16220.82580.43140. 07600. 7803i-x(:)0. 25430. 75720. 79430. 53830.91060. 23990. 3897a=diag(x)0.81430. 75370.31120.99610.18180.12330. 24170. 24350.38040.52850.07820.26380.18390. 4039syms x;a=diag(x)0.92930. 56780.16560. 44270.14550. 24000.
15、 09650. 35000. 07590.60200.10670.13610. 41730.1320a=diag(x)0.19660. 05400.26300. 96190. 86930. 04970. 9421size (a, 1)fx0.25110. 53080. 65410. 00460. 57970. 90270.9561 vb=rand(size(a)vcommand windowcolumns 8 through 140.05980.68680.79480.84430.40870.92890.98800.23480.18350.64430.19480.59490.73030.037
16、70.35320.36850.37860.22590.26220.48860.88520.82120.62560.81160.17070.60280.57850.91330.01540.78020.53280.22770.71120.23730.79620.04300.08110.35070.43570.22170.45880.09870.16900.92940.93900.31110.11740.96310.26190.64910.77570.87590.92340.29670.54680.33540.73170.48680.55020.43020.31880.52110.67970.647
17、70.43590.62250.18480.42420.23160.13660.45090.44680.58700.90490.50790.48890.72120.54700.30630.20770.97970.08550.62410.10680.29630.50850.30120.43890.26250.67910.65380.74470.51080.47090.11110.80100.39550.49420.18900.81760.23050.25810.02920.36740.7791workspace今1 p xj? select data to-namevaluemba<15x1
18、5 double0bb<15x15 double0.(bx<1x15 double1彐ans1515bs0.63450.(<1x1 sym>byi0.50000.!3y20.36330j>acommand historyxa2-5column 15tril(ans)x=l:2:29j;x(:)a=diag(x) syms x; a=diag(x) a=diag(x)size (a, 1) b=rand(size(a)2-6 和 2-7command window, ? x» e=d(8:4:10:13,7:l:6:9:2)e =empty matrix:
19、 6-by-0» einax=max(e(:)emax =empty matrix: o-by-1a»农妇为夫报仇17年抓获4孀犯 说n霄臟孚田田田田田田田田田c6田7ax<15x15 double > <15x15 double <15x15 double (<1x15 double <6x15 double>150.6345<1x1 $ym> <1x1 sym> 0.5000command history : p 11 xaclce=d(8 4 10 13,7:1:6:*卜clcsyms x y z;x&
20、#187;z>16clce=d(8:4:10:13, 7:1:6 emax=max(e(:)mcommand windowxworkspace口 戸xac % u % cp select data to » d=a. *bname *valuemba<15x15 double >0±b<15x15 double >0.(d =<15x15 double>0bx<1x15 double*1bans1515columns 1through 7田,0.63450.(ox<1x1 syw>by0.50000/0. 8909
21、000000bhy-0.36330j01. 05500000000002. 8441001. 6028000000<command history>x00002. 338800x=l:2:29;a000004. 41990-x(:)00000010. 1433a=diag(x)0000000syms x;0000000a=diag(x)0000000a=diag(x)0000000size (a, l)0000000b=rand(size(a)a?000a0八0a0d-d=a. *bvwork33- 1command windowa 0q0 1file edit view inse
22、rt tools desktop window help5? select data tovalueempty matrix: 6-by-0» emax=max(e(:)emax =empty matrix: 0-by-l» x,y,z)meshgrid(1 inspace ( » val=x. *2+y. *2+z/2;» isosurface (x, y, z, val, 16) axis equala»<15x15 double ><15x15 double ><15x15 double >(<1
23、x15 double ><6x15 double >150.6345<100x100x100 dou. <100x100x100 dou. <100x100x100 dou. v)ryf2=16:(e(:)u“,:,meshgrid(linsp. 卜 val=x. *2+y. *2+z/2; isosurface(x, y, z, val, i1 axis equal3-1- (1)command window» e=d(8:4:10:13,7:l:6:9:2)e =empty matrix: 6-by-0» eraax=n!ax<
24、e(:)eicax =empty matrix: 0-by-l» lx,y, z=meshgrid(linspace(-10,10); » val=x. "2+y. "2+z/2;» isosurface (x, y, z, val, 16) axis equala»lwork 4 4-1workspacexlj? select data to. namevalueba<15x15 doubleabb<15x15 doublebd<15x15 double>be5 emax】bx<1x15 doublee
25、sa<6x15 dcuble>bans15bs0.6345sval<100x100x100 dou.bx<100x100x100 dou.ffly<100x100x100 dou.v<>command history , y xxk2+z"2=16clce=d(8:4:10:13, 7:1:6 emax=max(e(:)y, z=nieshgrid(linsp. val=x. 2+y. '2+z/2; isosurface (x, y, z, val, h axis equalcommand window» t=o:pi 5
26、0:4*pi;» y=exp(-t/3);a»nfigure 1-rle edit viewinsert tools desktop window help1'ns 曬0» y0=(exp(-t/3). *sin(3*t); » plot(t,y, -r,t,yo, :b)workspacex3鱸殛*select data to.name avaluesa<15x15 double*asb<15x15 double>sd<15x15 double>se(e emax】田x<1x15 double田a<6x
27、15 double2 ans155s0.6345田t<1x201 double >0val<100x100x100 dou.m田x<100x100x100 dou.-v<>command historypy=exp(-t/3); y0=exp(-t/3)*sin(3*t): yo=expz(-t/3). *sin(3*t clc' t=0:pi/50:4*pi; y=exp(-t/3); y0= (exp (-t/3). *sin(3* plot(t,y, -r ,t,yo, :bovr4-2command windowb =s» c=in
28、put c 输入一个字符: s); 输入一个字符:s » if c>=a & c=z disp(setstr(abs(c)+l)口? x workspace口?xlpsele. name valueab|as1aqbrs-11田ds1,0,9;4,25,cbe1,2,3;4,5,6;.3 emaxfflx<1x15 doulsa<6x15 doul3 ans<3x3 logicsmlyev<>elseif c>= a & c= z disp(setstr(abs (c)-1) elseif c=o & c<= 9
29、j disp str2nwm(c) elsedisp endra»command history,口?1 x elseif c>=a & disp (setstr (abs ( elseif c=o & disp str2nwm(c) else卜disp(c):end| ovr4-2- (2)command windowbfigure 1- °file edit view insert tools desktop window helpvorkspaceifcxa &<=*» 3ans3» x=0:0. 01:4*pi
30、;» yl=sin(x);» y2=cos(x);» plot (x,yl, -r,x, y2, g)» plot (x,y 1, -r,x, y2, : ga»q d nj i k o ® 43 乂 ©口dame value3a<15x15 double*3b<15x15 double>3cifc>=.a.&<=.z"3d<15x15 double*3e03 emax3x<1x15 doublo3a<6x15 double*3 ans3jcb0.6345&l
31、t;1x201 double*select data to .m avcommand history x=0:0. 01:4*pi; yl=sin(x);卜y2=cos(x);plot(x, yl/-r ,x, y2,- plot(x, yl,-r,x, y2, : vovr4-2-3raworks 5-1- (1)command window>> a=l 2 3;舡 5 6;7009j ; >> wal 0 w;1q1oo1 2; » c=a+b;>>门ov刀-(3)gommand 工 istory lxc=a+b; > clca=l 2
32、3;4 5 6;7 b=鬥1 0 3;1 5 00 :c=a+b;0rd=>*b0v3d1门sbd -be2.2.6;5jo.e田d1.0,9:4,25 丄se(109s emax(3x<1x15 doul4250田a<6x15 doul0818三ans<3x3 logics» a=b< >command historyxjclcaans =a=l 2 3;4 5 6;7b=l 0 3;1 5 0;0101oa+b;010c000d=a. *ba=b7a»v<>|ovr5-2简述matlab命令窗的主要作用?(1) 命令窗门(
33、command window)位于matlab操作桌面的右方,用于输入命令并显示除 图形以外的所有执行结果,是matlab的主要交互窗口。(2) matlab既可以运行命令也可以执行程序,在命令窗口中可以运行单独的命令也可以调 用程序,相当方便,而编辑调试窗口和图像窗口都是程序运行结果展示窗口,可以很直观的 对程序运行过程中出现的矩阵或者是变量等等进行监视。(3) 在matlab命令窗口中可以看到有一个“”,该符号为命令提示符,表示matlab 正在处于准备状态。在命令提示符后输入命令并按回车键后,matlab就会解释执行所输入 的命令,并在命令后面给出计算结果。5-3简述matlab绘制二维
34、图形的一般步骤matlab绘制图形一般采取以下7个步骤:(1) 准备数据(2) 设置当前绘图区(3) 绘制图形(4) 设貫阁形屮曲线和标记点格式(5) 设置坐标轴和网格线(6) 标注图形(7) 保存和导出图形5-4启动simulink的方式有几种?1.启动 simulink启动simulink通常有三种方式:1直接从matlab指令窗口选取菜单file| new| modal命令,matlab将会打开simulink库浏 览器和名为untitled的模型窗口。2)在matlab命令窗u中键人simulink命令,matlab将会 打开simulink库浏览器。3点击matlab命令窗口工具条的
35、图标,启动simulink库浏览器。由启动simulink的三种方式,要新建一个模型文件,至少可以采用两种方式:1直接从matlab指令窗门选取菜单file|new|modal命令。2先启动simulink库浏览器,然后点击simulink库浏览器的工具条屮的“新建模型”阁标,建立新的模型文件。如果模型文件己经存在,至少有三种方法打开模型文件:1)从matlab指令窗门选取菜单 file|open 命令。2先启动simulink库浏览器,然后点击simulink库浏览器的工具条中的“打开模型”图标, 打开已经存在的模型文件,对它进行编辑、修改和仿真。3布matlab命令窗口中键人模型文件名称,
36、不需要.mdl后缀。simulink用不同的窗口站示 模诀库、模型号和仿真输出图形结果.这些窗口不是matlab图形窗口,不能用句柄图形命 令來操作。5-5command window » mysum=0;i=l; » while(i<=20) mysum=mysum+i i=i+l endmysumworkspacexsele.rnamevalueba1t2f3;4t5.6f asbbe2.2.6:5,10,田d10,9;4,25,c:3e3 emaxbx<1x15 doul田a<6x15 doul3 ans<3x3 logicaxavcomman
37、d history,口?xmysum(d=a. *b ha=bhmysum=o;i=l;-while(i<=20) mysum=raysum*i |-i=i+l l end5-5-1command window» c=a;10,11,12c =1 234 567 89101112» b=c(1:3, 2 3)b =2 35 68 9fxj c-r f.o .command window口 ? xworkspacen ?xmysum =aselername avalueba1,2,3;4,5,6fa190田b田cp.2.6:5j0,bd1,0.9:4,25,cbe3 emaxi =田x<1x1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 租房合同协议书格式英文版英文版示例
- 文化墙建设招标文件范例
- 木制品原材料购销合同
- 塑料袋购销合同条款
- 特许加盟授权协议
- 交通道路工程设计勘察招标说明会
- 抹灰工程劳务合作
- 无房产证房屋交易合同
- 房屋居间合同买卖模板
- 家具购销合同样式设计
- 学生体质健康存在的主要问题及改进措施
- 2024年执业药师资格继续教育定期考试题库(附含答案)
- 安徽工程大学《自然语言处理及应用》2022-2023学年第一学期期末试卷
- 2024年室内设计协议书
- 中储粮西安分公司招聘真题
- 大学人工智能期末考试题库
- 2024土方开挖工程合同范本
- 建筑幕墙工程检测知识考试题库500题(含答案)
- 钢棚钢结构施工方案
- 新版第三类医疗器械分类目录
- 企业绿色供应链管理咨询服务合同
评论
0/150
提交评论