For Programmers: Free Programming Magazines  


Home > Archive > Matlab > August 2007 > Matlab version 7.3.0.298 (R2006b): error saving figures: I don't









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Matlab version 7.3.0.298 (R2006b): error saving figures: I don't
W. Dale Hall

2007-08-29, 7:16 pm

Hi there, MatFolk

As the subject line says, I'm running Matlab 7.3.0.298, on a Linux
box (RH Linux Enterprise, some mainly up to date 64-bit version),
and have been (probably since day one, only I didn't try this on
day one, so can't really say) getting this error whenever I attempt
to save a figure:

A little window jumps up, with this name

Error Saving Figure

and the text inside says:

Error using ==> pan
Too many output arguments

Geez. I only want to save a figure. I've saved figures in several
versions of Matlab. I don't get it. Suddenly, I'm panning to beat
the band.

Today, I thought I'd trace the process by locating the hgsave
function. OK, so I finally set a breakpoint in hgsave, where
the relevant call to pan is located. The code looks like this:

panstate(i) = pan(h(i),'ison');

where we're in some loop running over the handles h(*) of things
that want to be saved, I'm guessing. panstate must be filled.

OK, so somehow we pan this thing. But the weird things are

1. pan gets called with its (2) input variables in
the ... WRONG ORDER??? OK, someone smart at the
Mathworks saw this happening and wrote a little
block of code to swap the order when the figure
handle was first & mode was second. Was it too
much to correct the calling order in the routines
doing the calling?? Hey, not my call. It works
the way they done it, I'm not picky.

2. The mode is ... 'ison'??? There's NO mention of
any sort of 'ison' mode in pan. The valid modes
appear to be 'on','off','down','motion','up'.
Control flows by default to zoom!

3. WTF? zoom has no output. pan is being called so
it will provide a value for panstate(i), and
Matlab craps its buffers.

Do I have some mutant version of Matlab?

Any pointers, even if only to say

"hey, Dale, all the resta us Matlabbers on
Linux have long ago changed that mode to
"whogivesahoot", and we've been all that
much happier for it"

will be gratefully appreciated. Of course, a real
fix or workaround wouldn't be half bad, neither.

Dale
W. Dale Hall

2007-08-29, 10:14 pm

W. Dale Hall wrote:
> Hi there, MatFolk
>
>


... I've noticed that this:

> 3. WTF? zoom has no output. pan is being called so
> it will provide a value for panstate(i), and
> Matlab craps its buffers.
>


Isn't quite correct: as it turns out, zoom *does* return
a value, but it is not assigned to anything inside pan.
As a result, despite the value nargout = 1, varargout
remains undefined/uninitiated/unsomething.

This causes the function pan to fail, and leads to
my inability to save figures.

I've noticed that if I insert the line

varargout{nargout} = zoom( ... );

into pan.m to replace the offending

zoom( ... );

then I can save figures.

What I'm wondering, besides this:

> Do I have some mutant version of Matlab?
>


is: is this the correct way to handle this
nasty behavior? I'd really rather not hack up
Mathworks-written code. It seems a bit rude.


Dale
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com