how can i graph two graphs on one axes in GUI matlab

1 view (last 30 days)
So i need to graph a freeway(basically a line that starts from (0 15) and end at (20 15)) and then theres a break in the graph from (20 15) to (35 15) and then graphing another line from (35 15) to (80 15). Attached is my hw assignment.thanks

Answers (1)

Image Analyst
Image Analyst on 16 Mar 2018
To plot 2 graphs in one axes, assuming your have two sets of (x,y) coordinates you want to plot, try this:
plot(x1, y1, 'b-');
hold on;
plot(x2, y2, 'r-');
grid on;
  2 Comments
deo john
deo john on 16 Mar 2018
Thanks but this is regular matlab plotting and does not work in guide (GUI)
deo john
deo john on 16 Mar 2018
i figured out how to graph but when i use the slider to go all the way up to its max value my graph looks weird.I am going attach my file here for u to see. let me know where i messed up

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots 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!