




已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Matlab的判别和转换函数ISCHAR True for character array (string). ISCHAR(S) returns 1 if S is a character array and 0 otherwise.ISNUMERIC True for numeric arrays. ISNUMERIC(A) returns 1 if A is a numeric array and 0 otherwise. For example, sparse arrays, and double precision arrays are numeric while strings, cell arrays, and structure arrays are not.ISLOGICAL True for logical array. ISLOGICAL(X) returns 1 if X is a logical array and 0 otherwise. Logical arrays must be used to perform logical 0-1 indexing.ISNAN True for Not-a-Number. ISNAN(X) returns an array that contains 1s where the elements of X are NaNs and 0s where they are not. For example, ISNAN(pi NaN Inf -Inf) is 0 1 0 0.ISEMPTY True for empty matrix. ISEMPTY(X) returns 1 if X is an empty array and 0 otherwise. An empty array has no elements, that is prod(size(X)=0.ISINF True for infinite elements. ISINF(X) returns an array that contains 1s where the elements of X are +Inf or -Inf and 0s where they are not. For example, ISINF(pi NaN Inf -Inf) is 0 0 1 1.ISFINITE True for finite elements. ISFINITE(X) returns an array that contains 1s where the elements of X are finite and 0s where they are not. For example, ISFINITE(pi NaN Inf -Inf) is 1 0 0 0. For any X, exactly one of ISFINITE(X), ISINF(X), or ISNAN(X) is 1 for each element.ISOBJECT True for MATLAB objects. ISOBJECT(A) returns 1 if A is a MATLAB object and 0 otherwise. ISSTRUCT True for structures. ISSTRUCT(S) returns 1 if S is a structure and 0 otherwise.ISCELL True for cell array. ISCELL(C) returns 1 if C is a cell array and 0 otherwise.ISJAVA True for Java object arrays ISJAVA(J) returns 1 if J is a Java object array, and 0 otherwise.ISFIELD True if field is in structure array. F = ISFIELD(S,field) returns true if field is the name of a field in the structure array S.ISSPARSE True for sparse matrix. ISSPARSE(S) is 1 if the storage class of S is sparseand 0 otherwise.DOUBLE Convert to double precision. DOUBLE(X) returns the double precision value for X. If X is already a double precision array, DOUBLE has no effect. DOUBLE is called for the expressions in FOR, IF, and WHILE loops if the expression isnt already double precision. DOUBLE should be overloaded for all objects where it makes sense to convert it into a double precision value.INT2STR Convert integer to string. S = INT2STR(X) rounds the elements of the matrix X to integers and converts the result into a string matrix.NUM2STR Convert number to string. T = NUM2STR(X) converts the matrix X into a string representation T with about 4 digits and an exponent if required. This is useful for labeling plots with the TITLE, XLABEL, YLABEL, and TEXT commands. T = NUM2STR(X,N) converts the matrix X into a string representation with a maximum N digits of precision. The default number of digits is based on the magnitude of the elements of X. T = NUM2STR(X,FORMAT) uses the format string FORMAT (see SPRINTF for details). Example: num2str(randn(2,2),3) produces the string matrix -0.433 0.125 -1.67 0.288SPRINTF Write formatted data to string. S,ERRMSG = SPRINTF(FORMAT,A,.) formats the data in the real part of matrix A (and in any additional matrix arguments), under control of the specified FORMAT string, and returns it in the MATLAB string variable S. ERRMSG is an optional output argument that returns an error message string if an error occurred or an empty matrix if an error did not occur. SPRINTF is the same as FPRINTF except that it returns the data in a MATLAB string variable rather than writing it to a file. FORMAT is a string containing C language conversion specifications. Conversion specifications involve the character %, optional flags, optional width and precision fields, optional subtype specifier, and conversion characters d, i, o, u, x, X, f, e, E, g, G, c, and s. See the Language Reference Guide or a C manual for complete details. The special formats n,r,t,b,f can be used to produce linefeed, carriage return, tab, backspace, and formfeed characters respectively. Use to produce a backslash character and % to produce the percent character. SPRINTF behaves like ANSI C with certain exceptions and extensions. These include: 1. ANSI C requires an integer cast of a double argument to correctly use an integer conversion specifier like d. A similiar conversion is required when using such a specifier with non-integral MATLAB values. Use FIX, FLOOR, CEIL or ROUND on a double argument to explicitly convert non-integral MATLAB values to integral values if you plan to use an integer conversion specifier like d. Otherwise, any non-integral MATLAB values will be outputted using the format where the integer conversion specifier letter has been replaced by e. 2. The following non-standard subtype specifiers are supported for conversion characters o, u, x, and X. t - The underlying C datatype is a float rather than an unsigned integer. b - The underlying C datatype is a double rather than an unsigned integer. For example, to print out in hex a double value use a format like %bx. 3. SPRINTF is vectorized for the case when A is nonscalar. The format string is recycled through the elements of A (columnwise) until all the elements are used up. It is then recycled in a similar manner through any additional matrix arguments. See the reference page in the online help for other exceptions, extensions, or platform-specific behavior. Examples sprintf(%0.5g,(1+sqrt(5)/2) 1.618 sprintf(%0.5g,1/eps) 4.5036e+15 sprintf(%15.5f,1/eps) 4503599627370496.00000 sprintf(%d,round(pi) 3 sprintf(%s,hello) hello sprintf(The array is %dx%d.,2,3) The array is 2x3. sprintf(n) is the line termination character on all platforms.FPRINTF Write formatted data to file. COUNT = FPRINTF(FID,FORMAT,A,.) formats the data in the real part of matrix A (and in any additional matrix arguments), under control of the specified FORMAT string, and writes it to the file associated with file identifier FID. COUNT is the number of bytes successfully written. FID is an integer file identifier obtained from FOPEN. It can also be 1 for standard output (the screen) or 2 for standard error. If FID is omitted, output goes to the screen. FORMAT is a string containing C language conversion specifications. Conversion specifications involve the character %, optional flags, optional width and precision fields, optional subtype specifier, and conversion characters d, i, o, u, x, X, f, e, E, g, G, c, and s. For more details, see the FPRINTF function description in online help (search by Function Name for FPRINTF), or look up FPRINTF in a C language manual. The special formats n,r,t,b,f can be used to produce linefeed, carriage return, tab, backspace, and formfeed characters respectively. Use to produce a backslash character and % to produce the percent character. FPRINTF behaves like ANSI C with certain exceptions and extensions. These include: 1. Only the real part of each parameter is processed. 2. ANSI C requires an integer cast of a double argument to correctly use an integer conversion specifier like d. A similiar conversion is required when using such a specifier with non-integral MATLAB values. Use FIX, FLOOR, CEIL or ROUND on a double argument to explicitly convert non-integral MATLAB values to integral values if you plan to use an integer conversion specifier like d. Otherwise, any non-integral MATLAB values will be outputted using the format where the integer conversion specifier letter has been replaced by e. 3. The following non-standard subtype specifiers are supported for conversion characters o, u, x, and X. t - The underlying C datatype is a float rather than an unsigned integer. b - The under
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 农田过滤器安装施工方案
- 挖掘机河道绿化施工方案
- 2025员工终止劳动合同协议
- 通道机电维修方案范本
- 机关站策划方案范本
- 节制闸工程施工方案论坛
- 安徽装配式装修施工方案
- 兰陵无尘净化室施工方案
- 2025企业并购合同范本示例
- 2025年血站管理考试试题及答案
- 垃圾发电厂考试题库含答案全套
- 发育生物学实验教案
- 仁爱版九年级英语上册unit2topic1复习课市公开课一等奖省课获奖课件
- 北京市国内旅游合同书
- 公司品牌建设五年规划
- 第二单元 三国两晋南北朝的民族交融与隋唐统一多民族封建国家的发展 知识清单 高中历史统编版(2019)必修中外历史纲要上册
- 居室环境的清洁与消毒
- GB/T 39766-2021人类生物样本库管理规范
- GB/T 2900.50-2008电工术语发电、输电及配电通用术语
- GB/T 2518-2008连续热镀锌钢板及钢带
- GB/T 1689-2014硫化橡胶耐磨性能的测定(用阿克隆磨耗试验机)
评论
0/150
提交评论