Info

This question is closed. Reopen it to edit or answer.

How can I overlay plots that are generated by several looping functions?!

1 view (last 30 days)
Ok so I know this type of question has been asked a lot, and I'm sure I should be using the hold function in some way but I have been trying for over 2 hours now and I'm about to hit my head off a wall!
In a nutshell I have a function that draws in a lot of information from other scripts, generates eigenvalues and then plots real vs. imaginary. However I want to overlay three versions of these.
Currently there are two ways I can produce these three different plots:
1 - change a single figure in one of the input scripts 2- have three sets of each script so that I dont need to change the value
Im really not great at Matlab and I didn't produce the overall function that ties all of my scripts together so I'm not too confident about compiling this into one large function.
So far I have tried to incorporate the hold function within the function itself and in the command window when I run the functions however the functions require user input when they are running and this seems to be interrupting the hold command in some way!
Any help or ideas would be greatly appreciated!
thanks!
A desperate engineering student in their final year!
  1 Comment
Geoff Hayes
Geoff Hayes on 16 Jan 2015
Rebecca - could you please clarify what you mean by ...this seems to be interrupting the hold command in some way. What is the observed behaviour? Do you end up having more than one figure, or does some data not appear on the figure, or ..? Should you be able to see all of the data at once i.e. are all x and y values within roughy the same range? (If vastly different, then the three sets of data may be so spread apart that you are only seeing the data from the last plot. (Which begs the question what data do you see on the figure(s) - the first, second or third set?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!