custom use of heavisde?

2 ビュー (過去 30 日間)
ABTJ
ABTJ 2019 年 5 月 14 日
コメント済み: Walter Roberson 2019 年 5 月 18 日
I want to make a function just like the one in attached photo using heaviside command
The graph i get by using my following code,does not continue after t=2
I am trying my following code:(how can i change this code to get output plot like the attached photo)
clc
clear all
close all
syms t
x=[heaviside(t)-heaviside(t-1)]+heaviside(t-2)
ezplot(x)
axis([-0.5 4 -0.25 1.5])

採用された回答

darova
darova 2019 年 5 月 14 日
How to atomate it?
x1 = [1 1 -1 -1 1 1];
x2 = [0 1 1 2 2 3];
y = heaviside(x1);
plot(x2,y)
xlim([-0.5 3.5])
axis equal
  3 件のコメント
darova
darova 2019 年 5 月 15 日
編集済み: darova 2019 年 5 月 15 日
Hell im good
syms t
x = heaviside(t-2)-heaviside(t-1)+1;
ezplot(x,[0 3])
xlim([-0.5 3.5])
axis equal
Walter Roberson
Walter Roberson 2019 年 5 月 18 日
If I recall correctly in R2015a you needed to use fplot() instead of ezplot() for symbolic expressions.

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by