How to plot a decresing part of a function

Hi everyone, I'm here because I'm lack of ideas about how to plot this function. I can plot the firt part (blue circle), but I don't know how to plot the decreasing part (red circle).
Someone can help me?
By now this is my code.
t = -1:0.001:2;
us=zeros(size(t));
unistep(t>=1)=1
us=
plot(t,us,'b','linewidth',3);

Answers (1)

It depends on how you want to plot it.
The slope m is and the line you want to plot intersects the x-axis at . The linear slope-intercept relation is (of course):
so, since when , you can calculate the y-intercept b, then use those to plot the line.

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 23 Mar 2021

Answered:

on 23 Mar 2021

Community Treasure Hunt

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

Start Hunting!