MATLAB: How do i close plotted graph

close funtion

I am trying to close a graph automatically after 5 second of view

Best Answer

Try this:
figure
plot(randn(1, 10))
hf = gcf;
pause(5)
close(hf)