According to my knowledge subplot() is used inside loop to display all images in a single figure. I tried it, but I get separate figures e.g. 24 counter in a loop for 24 images than 24 separate figures get opened. How can I solve this problem?
Are you looking at graphing multiple curves within one figure? If so, all you need is a 'hold on' command to keep adding to your figure. See Guram's answer for an example of how to use it.