cellfun in axis.m produces an error

Ben Abbott bpabbott at mac.com
Wed Jun 17 09:36:12 CDT 2009


On Wednesday, June 17, 2009, at 10:20AM, "Bertrand Roessli" <bertrand.roessli at psi.ch> wrote:

>On Wed, 2009-06-17 at 09:54 -0400, Ben Abbott wrote:
>> On Wednesday, June 17, 2009, at 09:38AM, "Bertrand Roessli" <bertrand.roessli at psi.ch> wrote:
>> >Hello,
>> >
>> >I have a script that calls the pcolor 
>> >function many times
>> >
>> >e.g. 
>> >
>> >hold on
>> >p=[2,2,0,1.5,2.5,-0.5,0.5];
>> >[x1,y1,z1]=diffuse(p);
>> >pcolor(x1,y1,z1);
>> >p=[1,1,0,0.5,1.5,-0.5,0.5];
>> >[x2,y2,z2]=diffuse(p);
>> >pcolor(x2,y2,z2);
>> >...
>> >
>> >With the 'Axis tight' command, I get 
>> >this error:
>> >
>> >error: cellfun: expecting all values to be scalars for UniformOutput =
>> >true
>> >error: evaluating argument list element number 1
>> >error: evaluating argument list element number 1
>> >
>> >
>> >The error seems to come from 
>> >
>> >lims(1) = min (cellfun (@min, data)(:)); 
>> >lims(2) = min (cellfun (@max, data)(:)); 
>> >
>> >at line 301 in axis.m
>> >
>> >I do not know if it solves the problem, but if I replace these 
>> >two lines with 
>> >
>> >lims_min=min(cellfun(@min,cellfun(@min,data,'UniformOutput',false)(:))); 
>> >lims_max=max(cellfun(@max,cellfun(@max,data,'UniformOutput',false)(:))); 
>> >lims = [lims_min, lims_max]; 
>> >
>> >it works for me.
>> >
>> >
>> >Bertrand Roessli
>> >
>> 
>> The 'tight' functionality for axis.m was recently modified.
>> 
>> What version of octave are you running. If you're running the developers sources, what is your tip.
>> 
>> Ben
>
> I have octave 3.2.0
>
>Bertrand

ok, if you can provide a complete example, I can check to see if the problem remains ... or you can try replacing your axis.m function with the current 3.2.x version and let us know if it works for you.

    http://hg.tw-math.de/release-3-2-x/file/d6052da689e2/scripts/plot/axis.m

Click on the "raw" link and it should download. Be sure to place it in a location where it will precede the installed axis.m (your current working directory will work).

Ben




More information about the Bug-octave mailing list