Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
New graphics system has significant performance problems
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I recently upgraded from version 2013 to 2014 and immediately noticed a serious degradation in the performance of my program.
Background: I had developed a specialized medical image viewer (using GUIDE) that translated mouse motion to other functionality depending on the mode the user selects. For example, if the user is in "zoom mode" then moving the mouse caused the image to zoom in & out. This is the standard/expected behavior for most programs of this type. Essentially, all I do is translate the mouse position so that it sets the xlim & ylim appropriately. (see code below)
It works well in version 2013 but is sluggish & jerky in 2014. It's almost tolerable but as my code gets more complicated the sluggishness seems to compound until the program (which works fine in 2013) is UNUSABLE in 2014.
I contacted the Mathworks. They offered a couple suggestions but basically told me that I need new hardware. Can anyone help?
I'm basically STUCK using version 2013 unless I either do a major rewrite of my program or spend a lot of money.
Dan
*********
%Get mouse position
a_iCurrentPosition=get(handles.Perfusion,'currentpoint');
%Get x&y axis limits
a_fXlim=get(handles.fActiveAxes,'Xlim');
a_fYlim=get(handles.fActiveAxes,'Ylim');
%Set zoom factor depending on mouse vertical direction
fMultiplier=1.05;
if (handles.fPreviousMousePosition(2)<a_iCurrentPosition(2))
fMouseWindowMultiplier=fMultiplier;
elseif (handles.fPreviousMousePosition(2)>a_iCurrentPosition(2))
fMouseWindowMultiplier=1/fMultiplier;
else
fMouseWindowMultiplier=1;
end
%Center axis limits around zero & multiply
fShift=(abs(a_fXlim(1)+a_fXlim(2))/2);
a_fXlim=a_fXlim-fShift;
a_fXlim=a_fXlim*fMouseWindowMultiplier;
a_fXlim=a_fXlim+fShift;
%Center axis limits around zero & multiply
fShift=(abs(a_fYlim(1)+a_fYlim(2))/2);
a_fYlim=a_fYlim-fShift;
a_fYlim=a_fYlim*fMouseWindowMultiplier;
a_fYlim=a_fYlim+fShift;
%Set new axis limits
set(handles.fActiveAxes,'Xlim',a_fXlim,'Ylim',a_fYlim);
%Save previous mouse position
handles.fPreviousMousePosition=a_iCurrentPosition;
1 Commento
Sean de Wolski
il 23 Mar 2015
It's pretty much impossible to debug guide programs without both files.
Did you try the various drawnow operations inside of the callback?
Risposte (0)
Questa domanda è chiusa.
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!