资源描述:
《Matlab的判别和转换函数.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、Matlab的判别和转换函数ISCHARTrueforcharacterarray(string).ISCHAR(S)returns1ifSisacharacterarrayand0otherwise.ISNUMERICTruefornumericarrays.ISNUMERIC(A)returns1ifAisanumericarrayand0otherwise.Forexample,sparsearrays,anddoubleprecisionarraysarenumericwhilestrings,cellarrays,ands
2、tructurearraysarenot.ISLOGICALTrueforlogicalarray.ISLOGICAL(X)returns1ifXisalogicalarrayand0otherwise.Logicalarraysmustbeusedtoperformlogical0-1indexing.ISNANTrueforNot-a-Number.ISNAN(X)returnsanarraythatcontains1'swheretheelementsofXareNaN'sand0'swheretheyarenot.Forex
3、ample,ISNAN([piNaNInf-Inf])is[0100].ISEMPTYTrueforemptymatrix.ISEMPTY(X)returns1ifXisanemptyarrayand0otherwise.Anemptyarrayhasnoelements,thatisprod(size(X))==0.ISINFTrueforinfiniteelements.ISINF(X)returnsanarraythatcontains1'swheretheelementsofXare+Infor-Infand0'swhere
4、theyarenot.Forexample,ISINF([piNaNInf-Inf])is[0011].ISFINITETrueforfiniteelements.ISFINITE(X)returnsanarraythatcontains1'swheretheelementsofXarefiniteand0'swheretheyarenot.Forexample,ISFINITE([piNaNInf-Inf])is[1000].ForanyX,exactlyoneofISFINITE(X),ISINF(X),orISNAN(X)is
5、1foreachelement.ISOBJECTTrueforMATLABobjects.ISOBJECT(A)returns1ifAisaMATLABobjectand0otherwise.ISSTRUCTTrueforstructures.ISSTRUCT(S)returns1ifSisastructureand0otherwise.ISCELLTrueforcellarray.ISCELL(C)returns1ifCisacellarrayand0otherwise.ISJAVATrueforJavaobjectarraysI
6、SJAVA(J)returns1ifJisaJavaobjectarray,and0otherwise.ISFIELDTrueiffieldisinstructurearray.F=ISFIELD(S,'field')returnstrueif'field'isthenameofafieldinthestructurearrayS.ISSPARSETrueforsparsematrix.ISSPARSE(S)is1ifthestorageclassofSissparseand0otherwise.DOUBLEConverttodou
7、bleprecision.DOUBLE(X)returnsthedoubleprecisionvalueforX.IfXisalreadyadoubleprecisionarray,DOUBLEhasnoeffect.DOUBLEiscalledfortheexpressionsinFOR,IF,andWHILEloopsiftheexpressionisn'talreadydoubleprecision.DOUBLEshouldbeoverloadedforallobjectswhereitmakessensetoconverti
8、tintoadoubleprecisionvalue.INT2STRConvertintegertostring.S=INT2STR(X)roundstheelementsofthematrixXtointegersandconver