- Time since last event: 0.04 s
- Time since last event: 0.04 s
- Time since last event: 0.04 s
- Time since last event: 0.03 s
- Time since last event: 0.04 s
- Time since last event: 0.04 s
- Time since last event: 0.04 s
- Time since last event: 0.05 s
- Time since last event: 0.05 s
- Time since last event: 0.04 s
- Time since last event: 0.03 s
- Time since last event: 0.03 s
- Time since last event: 0.04 s
- Time since last event: 0.03 s
- Time since last event: 0.04 s
- Time since last event: 0.04 s
- Time since last event: 0.04 s
- Time since last event: 0.04 s
- Time since last event: 0.04 s
extremely bad performance of event issuing by slider uicontrol in version R2020b
조회 수: 1 (최근 30일)
이전 댓글 표시
I have observed that in the new version of Matlab, the slider uicontrol does not issue events properly when used continuously. The value of the slider does not change as the user moves the slider.
I attach a function that illustrates this behaviour.
function sliderPerformance
function sliderPerformance
nfig = figure();
x = linspace(0,2*pi,10000);
hplot = plot(x,cos(0*x),'LineWidth',2);
ylim([-2,2]);
h = uicontrol('style','slider','units','pixel','position',[20 20 300 20],'Parent',nfig);
% checks continuosly the update of the value in the slider
addlistener(h,'Value','PostSet',@(hObject, event) updatePlot(hObject, event,x,hplot));
function updatePlot(src,event,x,hplot)
persistent lastVisit
if isempty(lastVisit);
lastVisit = clock();
return
else
thisVisit = clock();
end
fprintf('Time since last event: %5.2f s\n',etime(thisVisit,lastVisit));
hSlider = event.AffectedObject;
n = hSlider.Value;
hplot.YData=cos(x*n);
ylim([-2,2]);
drawnow;
lastVisit = thisVisit;
When operated from any version previous to R2020b, the plot transitions smoothly as the user moves the slider, and (a sample of) the readout to the screen is:
Time since last event: 0.01 s
Time since last event: 0.11 s
Time since last event: 0.06 s
In R2020b, the plot transition is bumpy, and, accordingly the readout:
Time since last event: 0.08 s
Time since last event: 0.47 s
Time since last event: 1.11 s
Time since last event: 2.25 s
Time since last event: 4.51 s
Time since last event: 3.46 s
Time since last event: 4.65 s
Is something that can be done? Is this reportable as a bug?
댓글 수: 0
답변 (1개)
Cris LaPierre
2020년 12월 11일
Your code runs smoothly for me in 20b and 21a prerelease.
Times are
댓글 수: 8
Cris LaPierre
2020년 12월 14일
If you are noticing a drastic difference in behavior from one version to another, I know they'd love to hear about it. Sory I couldn't be of more help. You can submit your feedback here.
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!