Trying to create a script that will plot a unit step fuction with an argument depending on two variables.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tony Dimichele
am 6 Okt. 2020
Kommentiert: Tony Dimichele
am 6 Okt. 2020
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/373241/image.png)
This is the function I am trying to create and plot in MATLAB, so far I have this code which is not correct I believe.
x = (-50:0.01:50);
a = -50:.01:50;
impulse = x==0;
us = x>=0;
Fx = x/a*(us.*(x-a)-us.*(x-2*a));
plot(x, Fx)
Which creates this graph.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/373246/image.png)
Which isn't correct either. I'm looking at my equation and I know it isn't going to give me the correct output, but I'm not sure what coding wizardry I should use to accomplish this task. Perhaps I'm not thinking of the math itself properly either.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!