how to close a particular figure file if it exists
Mostrar comentarios más antiguos
how to close a particular figure file
i used the below figure file.....
figure(6),
set(gcf, 'Name','Selected Image','numbertitle','off');
imshow(inputImage);
now the second time i execute if that figure file exists i want to delete only that particular figure file... i did as below...
if exist('Selected Image', 'file')
close 'Selected Image'
end
no error is showing nor it is getting deleted..... how to write the syntax... please do reply.....
Respuesta aceptada
Más respuestas (1)
Mahdi
el 9 de Abr. de 2013
I tried running the same thing and it worked, however, I assume that your main problem is in the if statement, not the close line.
Run the script in debugger and see if it's actually going through the if statement. Look up how the exist() outputs work because 1 is not always the output. I would suggest changing it to something like
if exist('Selected Image', 'file')~=0
close 'Selected Image'
end
Categorías
Más información sobre Basic Display en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!