octave-maintainers
[Top][All Lists]
Advanced

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

Re: trouble with refreshdata?


From: Ben Abbott
Subject: Re: trouble with refreshdata?
Date: Tue, 23 Mar 2010 17:04:05 -0400

On Tuesday, March 23, 2010, at 04:04PM, "Ben Abbott" <address@hidden> wrote:
> On Tuesday, March 23, 2010, at 03:18PM, "John W. Eaton" <address@hidden> 
> wrote:
>>On 22-Mar-2010, Ben Abbott wrote:
>>
>>| I have a rather recent build. I tried running the refreshdata demo, but ...
>>| 
>>| demo refreshdata
>>| refreshdata example 1:
>>|  x = 0:0.1:10;
>>|  y = sin (x);
>>|  plot (x, y, "ydatasource", "y");
>>|  for i = 1 : 100
>>|    pause(0.1)
>>|    y = sin (x + 0.1 * i);
>>|    refreshdata(gcf(), "caller");
>>|  endfor
>>| 
>>| refreshdata example 1: failed
>>| cell2mat: elements must be numeric, char or logical
>>| 
>>| Is anyone else seeing this?
>>| 
>>| The error occurs at line 85.
>>| 
>>|  79   for i = 1 : numel (h)
>>|  80     obj = get (h (i));
>>|  81     fldnames = fieldnames (obj);
>>|  82     m = regexpi (fieldnames(obj), "^.+datasource$", "match");
>>|  83     idx = cellfun (@(x) !isempty(x), m);
>>|  84     if (any (idx))
>>|  85       props = [props; {cell2mat(m(idx))}];
>>|  86       objs  = [objs ; h(i)];
>>|  87     endif
>>|  88   endfor
>>| 
>>| Ben
>>
>>Yes, I can duplicate this problem, but I don't knwo what the proper
>>solution is as I don't really understand what this code is trying to
>>do.
>>
>>Can you identify what changed so that this is now failing?  Unless the
>>change was intentional, then maybe that is the real bug.
>>
>>jwe
>
>I'm also unfamiliar with this code, but I'll take a look as my time permits.
>
>If someone else has an idea what this code is trying to do, please let me know.
>
>Ben
>

Ok, I think I see what changed. The changeset below changed how cell2mat 
behaved when the input was a cell of cells.

    http://hg.savannah.gnu.org/hgweb/octave/rev/c0d0b6e37a36

I made a trivial change to allow cell2mat to work for ...

octave:1> cell2mat ({{1},{2},{3}})
ans =

{
  [1,1] =  1
  [1,2] =  2
  [1,3] =  3
}

Is there any reason why this example should give an error?

Ben







reply via email to

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