【问题标题】:Plot two functions on the same graph in MATLAB using ezplot使用 ezplot 在 MATLAB 中的同一图上绘制两个函数
【发布时间】:2011-07-06 21:06:33
【问题描述】:

我想在 MATLAB 中使用 ezplot() 绘制以下三个函数,但我希望这些函数位于同一个图表上以轻松解释差异。这可能吗?如果是这样怎么办?这三个功能是:

x^3
x^5
x^7

谢谢,
神秘的xhobo

【问题讨论】:

    标签: matlab plot higher-order-functions


    【解决方案1】:

    只需使用hold on 将它们连续绘制在相同的轴上:

    figure;
    hold on;
    ezplot('x^3');
    ezplot('x^5');
    ezplot('x^7');
    

    【讨论】:

    • 有没有办法给每个图贴上标签,或者用不同的颜色来识别它们?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-05
    • 1970-01-01
    • 1970-01-01
    • 2016-08-15
    • 1970-01-01
    • 2019-06-12
    相关资源
    最近更新 更多