【问题标题】:How to plot a step function in Mathematica?如何在 Mathematica 中绘制阶跃函数?
【发布时间】:2019-11-30 22:43:42
【问题描述】:

我想在数学中绘制一个离散函数,例如,如下所示: X=[X1,x2,X3]and Y = {1 if X

此外,如果我更改 X1、X2 或 X3 的值,我想使用 Manipulate 代码来了解步进函数如何移动。

非常感谢您的帮助!

【问题讨论】:

    标签: wolfram-mathematica discrete-mathematics manipulate


    【解决方案1】:
    Manipulate[
      Plot[
        Piecewise[{{1,X<=X1},{20,X1<X<=X1+X2},{40,X1+X2<X<=X1+X2+X3}}],
        {X,0,100}],
      {{X1,25},0,100},{{X2,25},0,100},{{X3,25},0,100}]
    

    研究Manipulate DocsPiecewise Docs,直到你认为你拥有这个。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多