Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
New graphics system has significant performance problems
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Sean de Wolski
2015년 3월 23일
It's pretty much impossible to debug guide programs without both files.
Did you try the various drawnow operations inside of the callback?
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!