Combine 3 fig. graphs in one plot to compare each other
Show older comments
Hi, I have three graphs from 3 differnet simulation which represent different resutls. I wanna combine them together in plot, and I have tried differnet ways, but unfortunately I was not successful, I upload these three graphs as screenshots, because they exceed the 5MG limit.
And I appreiciate it if anyone could help me with this problem.
Thanks and have a good day!
Accepted Answer
More Answers (1)
Jon
on 23 Mar 2023
You should run each of the simulations keeping the results in local variables stored in the base workspace, and then plot the data using these variables. So for example suppose the results of running the first simulation were kept in the variable t1,x1 the second simulation in t2,x2, and for the third t3,x3 then you could plot the combined results using
plot(t1,x1,t2,x2,t3,x3)
3 Comments
Jon
on 23 Mar 2023
Of course this is highly simplified, just to illustrate the concept. You would naturally add plot titles, xlabels, perhaps other details
Jon
on 23 Mar 2023
You could also consider keeping the results in arrays rather than naming them t1,x1, t2,x2 etc
Saba Hajhassan
on 23 Mar 2023
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
