plot multiple functions in the same graph in matlab in matlab
main.m
% Define the range of x valuesx = -2*pi:0.1:2*pi;
% Define the functions to ploty1 = sin(x);
y2 = cos(x);
y3 = tan(x);
% Plot all the functions in the same graphhold on
plot(x, y1)
plot(x, y2)
plot(x, y3)
legend('sin(x)', 'cos(x)', 'tan(x)')
hold off