how to plot two m.file in one plot
Show older comments
i have two PDE each one i calculated in m.file, but i want to draw the output of first one as x, and the second as y
how can i do that
Accepted Answer
More Answers (1)
use plot(x, y), e.g.:
x = [-5:5;2*(-5:5); 3*(-5:5)];
y = [3*x.^2+3*x-3; -5*x.^2+5*x-15; -2*x.^2-3*x-13;];
plot(x(1,:),y(1,:), 'ro-', x(2,:),y(2,:), 'kp:', x(3,:),y(3,:), 'b--', 'LineWidth', 2)
grid on
xlabel ('x')
ylabel ("y(x)")
legend('Set 1', 'Set 2', 'Set 3', 'Location', 'Best')
Categories
Find more on General PDEs 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!