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?
Share
Either
close allbefore your generate the new figure if you’re not interested in the old output figure, or make afigurecall before creating the new image to ensure it pops up in a new figure window. Or, you can overwrite the current open figure by settinghold offfirst, although that’s specifically for graphs.