The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Problem with new figure under "KeyReleaseFcn"
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 60
Registered: 3/17/08
Problem with new figure under "KeyReleaseFcn"
Posted: Oct 26, 2012 5:23 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi all
I need to process some data that are presented in figure, using
KeyReleaseFcn function and than draw result in new figure.
Structure of code is following:

h = figure('KeyReleaseFcn',@whatPressed);
function whatPressed(src,evnt)

if strcmp(evnt.Modifier,'control') && strcmp(evnt.Key,'uparrow')
xzFig = figure;
end % of if

function ShowPlane(iZ,iG)
wrkFgr = imagesc(Y,X, yxCross);
end % of ShowPlane

end % of whatPressed

Problem is localized in line "xzFig = figure;"
When I run this function a few first times it works correctly,
but than new figure (xzFig) copy content of original figure (wrkFig) that is drawn
by ShowPlane function. Under debugger I see that this happens in line
"xzFig = figure;": new figure window is not empty but repeat content of
wrkFig figure from ShowPlane.

Exchange this line by "figure;" do not change function's behavior.

Exchange it by "xzFig = newplot" with or without parameters gives again
copy of original figure (wrkFig) immediately.

What is wrong, how I can have correct function reaction?

Thanks in advance for your ideas

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.