Elsie
Elsie

Reputation: 283

Matlab: How to clear the previous output image

I define values for the variables and call the function, it returns the output image in the figure. But when i want to test another set of data, the output image will come out, it's together with the previous output image. How can i solve it, do i need to add what code at the end of the function file?

Upvotes: 0

Views: 1336

Answers (1)

Dang Khoa
Dang Khoa

Reputation: 5823

Either close all before your generate the new figure if you're not interested in the old output figure, or make a figure call before creating the new image to ensure it pops up in a new figure window. Or, you can overwrite the current open figure by setting hold off first, although that's specifically for graphs.

Upvotes: 1

Related Questions