Merging Two Graphs into One in Matlab

  • Context: MATLAB 
  • Thread starter Thread starter Firben
  • Start date Start date
  • Tags Tags
    Graphs Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
Firben
Messages
141
Reaction score
0
Hello

Well since I'm a beginner in Matlab i have a question aboute ploting the graph. How can I merge two graphs into one ? Since i have function test(x,h) and function test2(x,h) both of them plotts in a two separate graphs. How do i do if i want to see both of them in a single graph ?

Regards

Carl F
 
Physics news on Phys.org
One way is to make your functions return a vector rather than just plotting it. Then it would be something like:

y1 = test1(x,h)
y2 = test2(x,h)
plot(x,y1,x,y2)