Re: a string, a string array and character array
- From: Walter Roberson <roberson@xxxxxxxxxxxx>
- Date: Wed, 10 Dec 2008 14:30:11 -0600
Arthur Zheng wrote:
Let's talking within the range of matlab. What is the difference between "a string"
and "a string array"?
"string array" is used, as best I can see, only in discussions of Mex routines,
where it is "an mxArray having the mxCHAR_CLASS class", which is the same thing
as a "character array", the term used in the rest of Matlab.
When "string" is used in Matlab, it refers to a row array of character, which
is to say an array of type character in which the first dimension is 1, the
second dimension is 1 or more, and all remaining dimensions are 1.
Otherwise, Matlab refers to character arrays, in which some additional dimension
might be something other than 1.
You might be confused by references to a "cell string array" or a "cell array
of strings". The "cell" is key there and "string array" cannot be removed from
the phrase without distorting the meaning severely. A cell string array
or a cell array of strings is a cell array, the entries of which are strings
(that is, row array of char.)
{'Hi', 'There'}
is a cell string array: that is, it is a cell array, the first cell of which
contains the 1 x 2 character array 'Hi', and the second cell of which contains
the 1 x 5 character array 'There'. A cell string array is an instance of a
generalized cell array; for example, {'Hi' 173 'There'} is a valid cell array,
the middle cell of which contains the 1 x 1 double array with the value 173,
and a cell string array is a cell array in which all the entries happen to be
strings.
--
..signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?
.
- Follow-Ups:
- Re: a string, a string array and character array
- From: Arthur Zheng
- Re: a string, a string array and character array
- References:
- a string, a string array and character array
- From: Arthur Zheng
- Re: a string, a string array and character array
- From: Rune Allnor
- Re: a string, a string array and character array
- From: Rune Allnor
- Re: a string, a string array and character array
- From: Arthur Zheng
- a string, a string array and character array
- Prev by Date: Re: Imagesc to visualize matrices
- Next by Date: Re: please help optimize this ('find' is too slow)
- Previous by thread: Re: a string, a string array and character array
- Next by thread: Re: a string, a string array and character array
- Index(es):
Relevant Pages
|