欢迎来到天天文库
浏览记录
ID:40569121
大小:236.00 KB
页数:32页
时间:2019-08-04
《MATLAB+中的常用操作符》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、MATLAB中的常用操作符其实这些是MATLAB帮助文件中的内容,可以利用help命令知道的。Arithmeticoperators.plusPlus+uplusUnaryplus+minusMinusuminusUnaryminusmtimesMatrixmultiply*timesArraymultiply.*mpowerMatrixpower^powerArraypower.^mldivideBackslashorleftmatrixdividemrdivideSlashorrightmatr
2、ixdivide/ldivideLeftarraydivide.rdivideRightarraydivide./kronKroneckertensorproductkronRelationaloperators.eqEqual==neNotequal~=ltLessthanleLessthanorequal<=geGreaterthanorequal>=Logicaloperators.ShortcircuitlogicalAND&&Shortcircuitlogic
3、alOR
4、
5、andElementwiselogicalAND&orElementwiselogicalOR
6、notLogicalNOT~xorLogicalEXCLUSIVEORanyTrueifanyelementofvectorisnonzeroallTrueifallelementsofvectorarenonzeroSpecialcharacters.colonColon:parenParenthesesandsubscripting()parenBrackets[]parenBracesan
7、dsubscripting{}punctFunctionhandlecreation@punctDecimalpoint.punctStructurefieldaccess.punctParentdirectory..punctContinuation...punctSeparator,punctSemicolon;punctComment%punctInvokeoperatingsystemcommand!punctAssignment=punctQuote'transposeTranspose.'
8、ctransposeComplexconjugatetranspose'horzcatHorizontalconcatenation[,]vertcatVerticalconcatenation[;]subsasgnSubscriptedassignment(),{},.subsrefSubscriptedreference(),{},.subsindexSubscriptindexBitwiseoperators.bitandBitwiseAND.bitcmpComplementbits.bitor
9、BitwiseOR.bitmaxMaximumfloatingpointinteger.bitxorBitwiseXOR.bitsetSetbit.bitgetGetbit.bitshiftBitwiseshift.Setoperators.unionSetunion.uniqueSetunique.intersectSetintersection.setdiffSetdifference.setxorSetexclusiveor.ismemberTrueforsetmemberMATLAB程式设计与
10、应用1-1、基本运算与函数在MATLAB下进行基本数学运算,只需将运算式直接打入提示号(>>)之後,并按入Enter键即可。例如:>>(5*2+1.3-0.8)*10/25ans=4.2000MATLAB会将运算结果直接存入一变数ans,代表MATLAB运算後的答案(Answer),并显示其数值於萤幕上。(为简便起见,在下述各例中,我们不再印出MATLAB的提示号。)===============================================小提示:">>"是MATLAB的提示符号(
11、Prompt),但在PC中文视窗系统下,由於编码方式不同,此提示符号常会消失不见,但这并不会影响到MATLAB的运算结果。===============================================我们也可将上述运算式的结果设定给另一个变数x:x=(5*2+1.3-0.8)*10^2/25x=42此时MATLAB会直接显示x的值。由上例可知,MATLAB认识所有一般常用到的加(+)、减(-)、乘(*)、除(/)的数学运算符号,以及幂次运
此文档下载收益归作者所有