Re: a string, a string array and character array



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)?
.



Relevant Pages

  • Re: add row to cell with different number of elements
    ... and add those to the cell array. ... You say that A and B always contain only one string array. ... I have never used the excel COM object link. ... Or will you need to conver it all to a character array before ...
    (comp.soft-sys.matlab)
  • Re: How to match string for cell array strmatch() in Matlab
    ... which the string contains 'a' for example. ... Requires character array or cell array of strings as inputs. ...
    (comp.soft-sys.matlab)
  • Re: NameValueCollections GetValues does not return multiple entries
    ... > then GetValuesreturns an array that contains only the first value ... > "Matt Berther" wrote in message ... >>> associated with a single key, I only get the last value. ... >>> string array, but only with a single value. ...
    (microsoft.public.dotnet.framework)
  • Re: Sorting a variant array
    ... Anyway, the point is tempList will become a 2D array, even if its one column ... move the Variant array into a String array which is what I thought might ... try and move them to a string array I get no debug output and ... Even if I don't try the movement to a String Array the sorting algorithm ...
    (microsoft.public.excel.programming)
  • Re: NameValueCollections GetValues does not return multiple entries
    ... > Hello Vagif, ... > The NameValueCollection returns a string array based on a string split on ... >> And the whole purpose og GetValues is to retrieve multiple values, ... >> string array, but only with a single value. ...
    (microsoft.public.dotnet.framework)