What is consuming physical memory?

1 次查看(过去 30 天)
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by