Plotting Multiple Equations on One Graph in MATLAB?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
chief10
Messages
78
Reaction score
0

Homework Statement



Does anyone know how to do this? Let's say I had the equation:

f(t) =
|2t, 0≤ t < 2
|(t^2)-3, 2≤t

how would you plot this over 0≤ t ≤4 in Matlab?


Homework Equations



-

The Attempt at a Solution



I've tried ezplot but i can't manage getting both equations on the same graph

Thanks guys and girls.

-chief10
 
Physics news on Phys.org
worked it out!

if anyone is interested the code is belowsyms x y
ezplot(function, [xmin,xmax])
hold on
ezplot(function2, [xmin,xmax])
hold off