MATLAB MATLAB 2010a surf bug? Can someone try to replicate?

  • Thread starter Thread starter mikeph
  • Start date Start date
  • Tags Tags
    Bug Matlab
AI Thread Summary
Users are experiencing issues with MATLAB 2010a when trying to pan a 3D surface plot created with the 'surf' function after rotating the view. The problem manifests as the image not moving correctly, accompanied by error messages related to cell contents referencing. A suggested solution is to use the command 'axis vis3d' to prevent MATLAB from rescaling the figure during rotation, which partially resolves the issue. However, some users still report difficulties with panning, particularly when viewing the plot from a vertical perspective. The discussion highlights the challenges of using 'surf' for certain visualizations and suggests alternatives like 'pcolor' for simpler 2D representations.
mikeph
Messages
1,229
Reaction score
18
Hello,

anyone with MATLAB 2010a would you be able to type the few lines of code into try to replicate this problem I am having?

Code:
>> p = rand(400);
>> surf(p)

Once you get the image, maximise the window and rotate the axis until you are looking vertically down (z-axis out the screen). Then zoom into the bottom left corner, and try to pan.

When I do this, rather than 'grabbing' the image and moving it, the image stays in the same place and the frame gets moved to cover part of the image up. I then get the accompanying error messages pop up:

Code:
? Cell contents reference from a non-cell array object.

Error in ==> pan>locWindowButtonUpFcn at 486
        if ~isequal(newlim{1},origlim{1})

Error in ==> hgfeval at 63
        feval(fcn{1},varargin{:},fcn{2:end});

Error in ==> uitools.uimode.modeWindowButtonUpFcn at 44
hgfeval(newButtonUpFcn,hFig,evd);

Error in ==> uitools.uimode.modeControl>localModeWindowButtonUpFcn at 144
hThis.modeWindowButtonUpFcn(hFig,evd,hThis,newValue);
 
? Error while evaluating figure WindowButtonUpFcn

[PLAIN]http://img820.imageshack.us/img820/945/matlaberror.jpg

Sometimes this happens, sometimes it doesn't. I tried it three times with this example, and the error messages only came up twice. The second time I tried it, it seemed to work fine.

Any idea what I'm doing wrong, or if it's a MATLAB error?

Thanks,
 
Last edited by a moderator:
Physics news on Phys.org
Hey, I had similar problems quite a while ago, but this should help.

axis vis3d

Pretty sure that the problem arises from MATLAB trying to "refit/rescale" the figure as you rotate it. vis3d tells it to leave it scaled for 3d rotation.

give it a try
 
Thanks, that definitely did something, but I am still unable to pan properly.
 
I want a surf to get images from many angles, and am having particular trouble doing this in the case that I am looking straight down onto it.
 
Back
Top