help-octave
[Top][All Lists]
Advanced

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

Re: strsplit on cell of strings


From: Andy Buckle
Subject: Re: strsplit on cell of strings
Date: Sun, 10 Oct 2010 13:56:43 +0100

On Sun, Oct 10, 2010 at 11:29 AM, Dr. Johannes Zellner
<address@hidden> wrote:
> Hi,
>
> strplit(c, ';')
>
> doesn't work apparently if c is a cell of strings.
> how can I do a strsplit on a cell of strings?

There may be a better way than this. I don't know how to avoid
looping. For example, to split the first string in the cell array:

octave-3.2.4.exe:1> cstr={"a;bb;c","aa;b;cc"}
cstr =

{
  [1,1] = a;bb;c
  [1,2] = aa;b;cc
}

octave-3.2.4.exe:4> strsplit(char(cstr{1}),';')
ans =

{
  [1,1] = a
  [1,2] = bb
  [1,3] = c
}

-- 
/* andy buckle */


reply via email to

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