




已阅读5页,还剩35页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
matlabprogrammingforengineers room414 ee ac sysu emails ynzhang ieee org zhynong yunongzhang 张雨浓 whatismatlab whydowelearnmatlab howdowelearnmatlab introduction whathaveyoulearnedfrommatlab abriefhistoryofmatlab engineeringandscientificapplicationsinvolvealotof numbercrunching formanyyears themainlanguageforthiswasfortran first highlevel programminglanguage andespeciallydesignedfornumericalcomputing here safortrancodetosolveax2 bx c 0 csolveaquadraticequation thisisacomment desc b b 4 a cif desc lt 0 0 goto10desc sqrt desc x1 b desc 2 0 a x2 b desc 2 0 a write 6 solutionsare x1 and x2return10write 6 equationhascomplexroots return problemsusingfortran numbercrunching onacomputercanbetricky problemsthatoccurare lossofprecisionandinaccurateresults x 0 1y 1 0 10 xy should equal0 butprobablydoesnot underflowandoverflow x 1 0e20 x x toobig efficientcodingofalgorithmsnotalwaysobviousdo10n 1 10000010y n sqrt 2 0 x n lessefficient cf inefficientprogrammingerrors solvingalinearsysteminfortran here safortrancodetosolvealinearsystemb a x solveforx itdoesn tcheckfordegeneracyorzeros csolveb a xforx cnisdimensionofvectorsandmatrixcdoesnotuserowinterchange scaling subroutinelinsys n a x b tmp integerndoubleprecisiona n n x n b n doubleprecisiontmp n ratioc forwardeliminationdo13j 1 n 1do12i j 1 nratio a i j a j j a i a i ratio row j do11k j 1 n11a i k a i k ratio a j k a i j 0 0x i x i ratio x j 12continue11continuecontinued c backwardssubstitutionx n x n a n n do21i n 1 1 1tmp x i do20j i 1 n20tmp tmp a i j x j x i tmp a i i 21continuereturnend thisisjustasmallexample afullprogrammaybethousandsoflineslong needfornumericallibraries theu s governmentrecognizedtheseproblems andtheinefficiencyofmanyengineersallwritingthesamealgorithms againandagain so theycommissionednumericalanalyststowritegoodqualityalgorithmsforcommontasks maketheresultsfreelyavailableas libraries ofsubroutinesthananyonecanuseintheirprograms librariesareavailableat lib org examplesofnumericallibraries blas basiclinearalgebrasubroutines operationsonvectors likeaddingtovectors dotproduct norm linpack linearalgebrasubroutinesforvector matrixoperations solvinglinearsystems factoringamatrix invertingamatrix laterreplacedbylapack eispack computeeigenvaluesandeigenvectorsofmatrices example solvea x businglinpack c factortheamatrixcallsgefa a n n ipvt info c copybvectorintoxvectorcallscopy n b 1 x 1 c solvethesystemofequationscallsgesl a n n ipvt x 0 stillnoteasyenough clevemoler mathematician c s professor andco authoroflinpack thoughtthisisstilltoomuchwork writefortran compile debug compile run hewantedtogivestudentseasyaccesstolinpack so hewrotematlab matrixlaboratory interactiveeasyinput easyoutputoperationsonawholevectorormatrixatonceexample solveb a xinmatlab x a b when immediatepopularity matlabquicklybecamequitepopularandusedforbothteachingandresearch itwasalsofree anengineer jacklittle sawmatlabduringalecturebyclevemoleratstanforduniversity hesawthecommercialpotentialand withpermission rewrotematlabincadded m files storedprograms addedmanynewfeaturesandlibrariesfoundedthemathworkstomarketit when softwareprinciples matlabillustratessomeusefuldesignconceptsforsoftware fortran c javacompiler linearalgebralibraries matlab matlab toolkits matlab m files standardbaseplatform modular reusablesoftwarecomponents extensibleusing toolkits oruser contributedprogramscalledm files interactiveuserinterface hidesboringdetails matlabtoday millionsofusers astandardtoolinbothprofessionalandacademicuse toolboxes providingfunctionsformanyapplications controlsystemsidentificationneuralnetworksbio informaticsstatisticsandtime seriesanalysiscandosymbolicmathematics too simulink guibasedsimulationtool matrixlaboratoryhigh performancelanguagefortechnicalcomputingcomputation visualization andprogramminginaneasy to useenvironment summary university levelcomputer programminglanguage cf java c fortran vb andmachine levelcpa typicalapplications mathandcomputationalgorithmdevelopmentmodelling simulation andprototypingdataanalysis exploration andvisualizationscientificandengineeringgraphicsapplicationdevelopment includinggraphicaluserinterfacebuilding applications example1 applications example1 cont solutionofode x 3 y x y xz 26 5x yz xy z butterflyeffect ode45functioninmatlab applications example2 applications example2 cont loadinganimage a imread picture jpg imshow a applications example2 cont showredplane a 2 3 0 imshow a loadinganimage a imread picture jpg imshow a applications example2 cont showgreenplane a 13 0 imshow a applications example2 cont showblueplane a 1 2 0 imshow a why dataanalysis applications example3 stockmarket predictedbyneuralnetworktoolboxinmatlabbp rbfneuralnetworktrainingthenetwork trainfunction applications example3 cont predictingexample applications example3 cont de noiseexample applications example3 cont advantagesofmatlab easetouseinterpretedlanguage likebasic integrateddevelopmentenvironment onlinedocumentation manuals anddemos etc platformindependenceindependenceofoperationsystemsandcomputers windows95 98 me nt 2000 xp unix linux andsuper computers predefinedfunctionsextensivelibraryofpredefinedfunctions suchasarithmeticmean standarddeviation median etc toolboxessuchascommunications controlsystems signalprocessing graphicaluserinterfaceinteractive easiertouseforinexperiencedusers advantagesofmatlab cont howtodefine slowforsomekindsofprocessesinterpretedlanguagenotdesignedforlarge scalesystemdevelopmenthighcostexpensiveforindividuals disadvantagesofmatlab matlabenvironment matlabdesktopincludesthefollowingwindows thecommandwindow thecommandhistorywindow launchpad workspace currentdirectory matlabenvironment cont thecommandwindow allowuserstoentercommandsat underthecommandpromptmatlabcalculatestheansweroncetheenterkeyispressedellipsis isusedifastatementistoolong x1 1 1 2 1 3 1 4 1 5 1 6 x1 1 1 2 1 3 1 4 1 5 1 6 cf ellipse thecommandhistorywindow displayalistofthecommandstypedbeforere executeacommandbydouble clickingitdeleteacommandbyrightclickingitandselectingtheitem deletesection fromthepopupmenu whatif thelaunchpad atreeofdocumentation demos andrelatedtoolsinstalledhere theworkspace computermemoryoccupiedbyvariablesandarraysusedbymatlabwhoslistvariablesandarraysinthecurrentworkspace theedit debugandfigurewindows anedit debugwindowisusedtocreateanew mfileortomodifyanexistingone clicktoolbaricontocreateanewoneclicktoolbaricontomodifyanexistingone afigurewindowisusedtodisplaymatlabgraphics importantcommands demo torunmatlab sbuilt indemonstrationsclc toclearthecontentsofthecommandwindowclf toclearthecontentsofthecurrentfigurewindowclear toclearthevariablesintheworkspace c ctrl c abortcommand toexecutecommandsofcomputer soperatingsystemdiary tocopyallinputandoutputdisplayedinthecommandwindowdiaryoff tosuspendinputintothediaryfilediaryon toresumeinputagain copyjzsf mjzsftest m searchingandlocatingfiles 1 itlooksforthenameasavariable ifitisavariable matlabdisplaysthecurrentcontentsofthevariable 2 itcheckstoseeifthenameisabuilt infunctionorcommand ifitis matlabexecutesthatfunctionorcommand 3 itcheckstoseeifthenameisanm fileinthecurrentdirectory ifitis matlabexecutesthatfunctionorcommand 4 itcheckstoseeifthenameisanm fileinanydirectoryinthesearchpath ifitis matlabexecutesthatfunctionorcommand searchingandlocatingfiles cont rememberinmindneveruseavariablewiththesamenameasamatlabfunctionorcommand otherwise thatfunctionorcommandwillbecomeinaccessible nevercreateanm filewiththesamenameasamatlabfunctionorcommand sin 5 sin 1 answer 5wrong whichtofindoutwhichversionofthefile andwhereitislocated searchingandlo
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 营销渠道拓展实战作业指导书
- 中考数学总复习《 圆》模拟试题及答案详解【名师系列】
- 自考专业(金融)自我提分评估【有一套】附答案详解
- 综合解析华东师大版7年级下册期末测试卷审定版附答案详解
- 重难点自考专业(学前教育)试卷含完整答案【名师系列】
- 中级银行从业资格之中级银行业法律法规与综合能力题库检测模拟题及参考答案详解(达标题)
- 环保公司能源管理办法
- 重庆市实验中学7年级数学下册变量之间的关系综合测评试卷(含答案详解版)
- 自考专业(计算机应用)试题预测试卷及答案详解(夺冠)
- 注册公用设备工程师过关检测试卷附完整答案详解【网校专用】
- 中铝矿业有限公司巩义市张家沟大发铝土矿矿山土地复垦与地质环境保护治理方案
- 班级管理常规优质课件
- IT运维服务方案信息运维服务方案
- ZSL1000、ZSL750塔吊外挂架施工方案
- 文化自信作文800字议论文
- GB/T 28287-2012足部防护鞋防滑性测试方法
- GB/T 27677-2017铝中间合金
- GB/T 19627-2005粒度分析光子相关光谱法
- 芜湖宜盛置业发展有限公司招聘3名编外工作人员(必考题)模拟卷
- 混凝土结构设计原理教学教案
- 齿轨卡轨车课件
评论
0/150
提交评论