[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matlab-compatible string class

From: John W. Eaton
Subject: Re: Matlab-compatible string class
Date: Fri, 29 Dec 2017 08:25:55 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 12/28/2017 07:57 PM, Richard Crozier wrote:

On 28/12/17 16:41, Rik wrote:
On 12/27/2017 09:38 PM, address@hidden wrote:

I don't see a smooth transition path either.  Although Matlab presents the string class as a fundamental data type, it is actually closer to a container data type like a cell array.  In fact, by using cell arrays of strings you can make portable code that will run in either Octave or Matlab.  Maybe this is unkind, but the principal advantage seems to be the syntactic sugar of using parentheses '()' for indexing rather than cell array indexing '{}'.

I believe you can also do things like:

x = "the cat " + "sat on the mat"

which is kind of handy. More like a python string.

This could have also been done with character arrays. Except that the original design of Matlab chose to have character arrays work like numbers when used with arithmetic operators.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]