Mat lab数据类型及转换
The Matlab data type conversion (2011-05-16 and 15:10:59) reproduced so
Tags: on Classification: memorants in the matrix, need to use DeBlank functions remove spaces such as name =char ("ABC”, "ABCD” (DeBlank) ; name
In addition, Matlab provides a more flexible array of cells, using the function cellstr to convert an array of strings into a cell array:
Data= char (' ABC' , ' ABCD')
Length (data (1: 4)) - >?
Cdata=cellstr (data)
Length (cdata{l)) - > 3?
Commonly used character manipulation functions
Blanks (n) returns n null characters
DeBlank (s) removes the null characters that are included in the tail of a string
(string) execute a string as a command
Findstr (SI, S2) search string
Ischar (s) determines whether the string
Isletter (s) determines whether the letters are letters
Lower (s) conversion lowercase
Upper (s) converts uppercase
Does StrCmp (SI, S2) compare strings?
Strncmp (SI, S2),
N) compare whether the first n characters in the string are identical
Strrep (SI, S2, S3) replaces the character S2 in SI with S3
date and time
Mat lab three date: date format strings such as, 1996-10-02 ' and the date sequence number such as 729300 (0000 January 1st 1) and date vector such as 1996102000, followed by the date when.
Commonly used date manipulation functions
Datestr (D, f) converts date numbers into strings
Datenum (STR, f) converts strings into date numbers
Datevec (STR) date string conversion vector
Weekday (d) calculates weeks
Eomday (yr, mth) calculates the last day of the specified month
Calendar (STR) returns the calendar matrix
Clock date vector for current date and time
Date current date string
Now the number of sequences for the current date and time
structure
Structure is an array that contains a named "data container” or field. Fields in a structure can contain any data.
building the structure of the array
assignment method
The following assignment command produces an array of structures called patien
Matlab数据类型及转换 来自淘豆网www.taodocs.com转载请标明出处.