MATLAB实验报告_4.docx

上传人:安*** 文档编号:18912996 上传时间:2022-06-03 格式:DOCX 页数:5 大小:16.36KB
返回 下载 相关 举报
MATLAB实验报告_4.docx_第1页
第1页 / 共5页
MATLAB实验报告_4.docx_第2页
第2页 / 共5页
点击查看更多>>
资源描述

《MATLAB实验报告_4.docx》由会员分享,可在线阅读,更多相关《MATLAB实验报告_4.docx(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、MATLAB实验报告四川师范大学MATLAB语言实验报告1系级班年月日实验名称:Intro,Expressions,Commands姓名学号指导老师成绩1ObjectiveTheobjectiveofthislabistofamiliarizeyouwiththeMATLABprogramdevelopmentenvironmentandtodevelopyourfirstprogramsinthisenvironment.2UsingMATLAB2.1StartingMATLABLogontoyourcomputerandstartMATLABbydouble-clickingontheic

2、ononthedesktoporbyusingtheStartProgramsmenu.MATLABDesktopwindowwillappearonthescreen.Thedesktopconsistsofseveralsub-windows.Themostimportantonesare:CommandWindow(ontherightsideoftheDesktop)isusedtodocalculations,entervariablesandrunbuilt-inandyourownfunctions.Workspace(ontheupperleftside)consistsoft

3、hesetofvariables(arrays)createdduringthecurrentMATLABsessionandstoredinmemory.CommandHistory(onthelowerleftside)logscommandsenteredintheCommandWindow.Youcanusethiswindowtoviewpreviouslyrunstatements,andcopyandexecuteselectedstatements.YoucanswitchbetweentheLaunchPadwindowandtheWorkspacewindowusingth

4、emenutabsunderthesub-windowontheupperleftside.Similarly,youcanswitchbetweentheCommandHistoryandCurrentDirectorywindowsusingthemenutabsunderthesub-windowonthelowerleftside.2.2ExecutingCommandsYoucantypeMATLABcommandsatthecommandprompt“ontheCommandWindow.Forexample,youcantypetheformulacos(/6)2sin(3/8)

5、as(cos(pi/6)2)*(sin(3*pi/8)Trythiscommand.Afteryoufinishtyping,pressenter.ThecommandwillbeinterpretedandtheresultwillbedisplayedontheCommandWindow.TrythefollowingbyobservinghowtheWorkspacewindowchanges:a=2;(Makenoteoftheusageof“;)b=3;c=a4?b?5+pi3Youcanseethevariablesa,bandcwiththeirtypesandsizesonth

6、eWorkspacewindow,andcanseethecommandsontheCommandHistorywindow.Spendafewminutestopracticedefiningarrayvariables(i.e.vectorsandmatrices)usingthesquarebracket(“)andcolon(“:)operators,andzeros()andones()functions.ar=12345;br=123;456;cr=1:3:15;?Setdrto?rst3elementsofar.?Setertosecondrowofbr.?Setartodrer

7、.Findthenumberofelementsofar.2.3GettingHelpThereareseveralwaystogethelponcommandsandfunctionsinMATLAB.FirstofallyoucanusetheHelpmenu.Youcanalsousethe“?button.Trytofindinformationontheplotfunctionfromthehelpindex.Alsotrytogetinformationonthesamefunctionusingthehelpcommand(i.e.typehelpplot).Finally,ex

8、perimentwiththelookforcommand.Thiscommandlooksforothercommandsrelatedtoagivenkeyword.2.4SomeUsefulCommandsTrythefollowingcommandsandobservetheirresults:Which:VersionandlocationinfoClear:ClearstheworkspaceClc:Clearsthecommandwindowwho,whos:Listscontentoftheworkspace3ExercisesPleasesolvethefollowingproblemsinMATLAB.Donotforgettokeepadiaryofyourcommandsandtheiroutputs.(1)De?nethevariablesxyandzas7.6,5.5and8.1,respectively,andevaluate:578.422.52?-xyxz此页面能否是列表页或首页?未找到适宜正文内容。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 应用文书 > 策划方案

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁