how to plot two m.file in one plot
显示 更早的评论
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
采纳的回答
更多回答(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')
类别
在 帮助中心 和 File Exchange 中查找有关 General PDEs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
