help-octave
[Top][All Lists]
Advanced

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

Re: 'for' loop on elements of cell array (octave-3.4.2) - is it the way


From: John W. Eaton
Subject: Re: 'for' loop on elements of cell array (octave-3.4.2) - is it the way it is supposed to be ?
Date: Thu, 2 Feb 2012 11:27:01 -0500

On  2-Feb-2012, Sergei Steshenko wrote:

| I am not sure the behavior is consistent.

It is consistent.

Consider this case instead:

  cell_array = {[1,2;3,4], "foobar"; [5,6], {7, "foo", [8,9,10]}};

  for elt = cell_array
    elt
  endfor

Do you see now why the columns must be extracted as cells, not the
individual cell elements?

jwe


reply via email to

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