What is consuming physical memory?

1 回表示 (過去 30 日間)
Silvia
Silvia 2013 年 6 月 24 日
Hello,
I have a problem. I have a GUI with three axes and three sliders. At the begining the program is fast but if you move the sliders for a while it becomes slow (it is consuming physical memory). Here it's the code of one of the sliders. ¿Could you please help me to know which is the problem?:
global XsYs;
sliderC=handles.tam(2)-floor(get(handles.sliderCoronal,'Value'))+1;
XsYs(1,1)=sliderC;
XsYs(3,2)=sliderC;
axes(handles.imagencoronal)
imshow(squeeze(handles.VolumenImagen(:,sliderC,:)),[])
axis off
if get(handles.boxcoronal,'Value')
plot([1 handles.tam(3)],[XsYs(2,1) XsYs(2,1)],'Color','y');
plot([XsYs(2,2) XsYs(2,2)],[1 handles.tam(1)],'Color','m');
end
set(gca,'DataAspectRatio',[handles.dataresol(3) handles.dataresol(2) handles.dataresol(1)]);
set(findobj(handles.imagencoronal,'Type','Image'),'ButtonDownFcn','Segmentacion(''buttonDownCallback'',gcbo,[],guidata(gcbf))');
set(handles.textcorteC,'String','Corte','string',sliderC);
delete(findobj(handles.Segmentacion,'Color','g'))
if get(handles.boxaxial,'Value')
plot(handles.imagenaxial,[1 handles.tam(3)],[sliderC sliderC],'Color','g','LineStyle','-');
end
if get(handles.boxsagital,'Value')
plot(handles.imagensagital,[sliderC sliderC],[1 handles.tam(1)],'Color','g','LineStyle','-');
end
clear sliderC;
guidata(handles.Segmentacion,handles)
Thank you

採用された回答

Jan
Jan 2013 年 6 月 24 日
As far as I can see, you create new picture by imshow() and some plots each time the callback runs. This occupies memory.
  1 件のコメント
Silvia
Silvia 2013 年 6 月 26 日
Thank you Jan!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by