custom use of heavisde?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
ABTJ
am 14 Mai 2019
Kommentiert: Walter Roberson
am 18 Mai 2019
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])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/219438/image.png)
0 Kommentare
Akzeptierte Antwort
darova
am 14 Mai 2019
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 Kommentare
Walter Roberson
am 18 Mai 2019
If I recall correctly in R2015a you needed to use fplot() instead of ezplot() for symbolic expressions.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!