Introduction to Scilab

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

! #   November2010AbstractInthisdocument,wemakeanoverviewofScilabfeaturessothatwecangetfamiliarwiththisenvironment.ThegoalistopresentthecoreofskillsnecessarytostartwithScilab.Inthe rstpart,wepresenthowtogetandinstallthissoftwareonourcomputer.Wealsopresenthowtogetsomehelpwiththeprovidedin-linedocumentationandalsothankstowebresourcesandforums.Intheremainingsections,wepresenttheScilablanguage,especiallyitsstructuredprogrammingfeatures.WepresentanimportantfeatureofScilab,thatisthemanagementofrealmatricesandoverviewthelinearalgebralibrary.Thede nitionoffunctionsandtheelementarymanagementofinputandoutputvariablesispresented.WepresentScilab'sgraphicalfeaturesandshowhowtocreatea2Dplot,howtocon gurethetitleandthelegendandhowtoexportthatplotintoavectorialorbitmapformat.Contents1Overview51.1Introduction................................51.2OverviewofScilab............................51.3HowtogetandinstallScilab.......................61.3.1InstallingScilabunderWindows.................71.3.2InstallingScilabunderLinux..................71.3.3InstallingScilabunderMacOS.................81.4Howtogethelp..............................81.5Mailinglists,wikiandbugreports....................91.6GettinghelpfromScilabdemonstrationsandmacros.........101.7Exercises..................................112Gettingstarted112.1Theconsole................................112.2Theeditor.................................122.3Docking..................................142.4Usingexec................................162.5Batchprocessing.............................172.6Exercises..................................1913Basicelementsofthelanguage203.1Creatingrealvariables..........................203.2Variablenames..............................213.3Commentsandcontinuationlines....................223.4Elementarymathematicalfunctions...................223.5Pre-de nedmathematicalvariables...................223.6Booleans..................................233.7Complexnumbers.............................243.8Integers..................................253.8.1Overviewofintegers.......................253.8.2Conversionsbetweenintegers..................263.8.3Circularintegersandportabilityissues.............273.9Floatingpointintegers..........................283.10Theansvariable.............................293.11Strings...................................293.12Dynamictypeofvariables........................303.13Exercises..................................304Matrices314.1Overview.................................314.2Createamatrixofrealvalues......................324.3Theemptymatrix[]...........................334.4Querymatrices..............................334.5Accessingtheelementsofamatrix...................344.6Thecolon:operator..........................354.7Theeyematrix..............................384.8Matricesaredynamic...........................394.9Thedollar$operator..........................394.10Low-leveloperations...........................404.11Elementwiseoperations..........................414.12Conjugatetransposeandnon-conjugatetranspose...........424.13Multiplicationoftwovectors.......................434.14Comparingtworealmatrices.......................444.15Issueswithoatingpointintegers....................454.16Moreonelementaryfunctions......................464.17Higher-levellinearalgebrafeatures...................484.18Exercises..................................485Loopingandbranching495.1Theifstatement.............................495.2Theselectstatement..........................505.3Theforstatement............................525.4Thewhilestatement...........................535.5Thebreakandcontinuestatements..................5426Functions556.1Overview.................................556.2De ningafunction............................576.3Functionlibraries.............................596.4Managingoutputarguments.......................616.5Levelsinthecallstack..........................626.6Thereturnstatement..........................636.7Debuggingfunctionswithpause.....................647Plotting667.1Overview.................................667.22Dplot..................................667.3Contourplots...............................687.4Titles,axesandlegends.........................717.5Export...................................738Notesandreferences749Acknowledgments7510Answerstoexercises7610.1Answersforsection1.7..........................7610.2Answersforsection2.6..........................7610.3Answersforsection3.13.........................7910.4Answersforsection4.18.........................82References83Index843Copyrightc2008-2010-ConsortiumScilab-Digiteo-MichaelBaudinThis lemustbeusedunderthetermsoftheCreativeCommonsAttribution-ShareAlike3.0UnportedLicense:

1 / 87
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功