Filter löschen
Filter löschen

GUIDE, images, memory issue

1 Ansicht (letzte 30 Tage)
Jason
Jason am 16 Okt. 2019
Beantwortet: Jason am 16 Okt. 2019
Hello, I have a memory Issue.
I am capturing upto 500 images (12 bit tiffs) and storing them in an array.
I preallocate memory:
numImages=500; %Maximum number of images in a stack
global imgArray;
imgArray=cell(numImages,1
Then in another function that captures the images (and adds to an exes component created using GUIDE),
I add to the image array
axes(handles.axes1); cla reset; %Remove any previous graphics on the axes
global imgArray;
imgArray{nextImgIdx}=img;
What I've noticed is at the end once I have finished, I have a seperate function that supposed to clear these images from memory, but looking in task manager, Im still seeing about 3G RAM being taken up from matlab.
%Function to clear memory taken from images
axes(handles.axes1); cla reset; %Remove any previous graphics on the axes
imgArray=[];

Antworten (1)

Jason
Jason am 16 Okt. 2019
Seems I forgot to put global in my clear function
global imgArray
imgArray=[];

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by