|
On Feb 21, 6:01 am, "Animesh Pandey" <apanimesh...@gmail.com> wrote:
> t = -4 : 0.01 : 4;
> r = @(t) t.*(t>=0).*(t>=0 & t<=1);
> h = @(t) (t>=0).*(t>=0 & t<=1);
> i = @(t) (t==0);
> x = @(t) r(t+2) + 2*h(t+1) + h(t) + -r(t-1);
> plot(t, x(t), 'r'), grid on
>
> In this question I am getting two impulses at t = -1 and t = 0 above the edge at x = 2 , but I don't need those pulses.
> Can you suggest a better way to plot the figure or may be a way to remove the impulses ???
>
> Please help !!!!
--------------------------------------------------
Here's one way. Just clip the values to 2:
xActual = x(t);
xActual(xActual>2) = 2; % Clip to 2
plot(t, xActual, 'r'), grid on
|