How to plot this signal x(𝑡) = (𝑡 + 2)𝑢(𝑡 + 2) − 2𝑡𝑢(𝑡) + (2(𝑡 − 4) + 2)𝑢(𝑡 − 4)?
Mostrar comentarios más antiguos
I just am unsure of the correct syntax for plotting a signal with unit step. This is what I have so far. It gives me an error saying incorrect dimensions but I don't know where to put . for multiplying.
clear all; close all; clc;
syms t t0
u(t) = piecewise(t<t0, 0, t>=t0, 1);
t = -10:1:10;
xt = (t+2)*u(t+2)-(2*t*u(t))+((2*(t-4)+2)*u(t-4));
plot(t,xt);
axis([0,40,-2,2])
title('x(t) = (t+2)*u(t+2)-(2*t*u(t))+((2*(t-4)+2)*u(t-4))')
xlabel('t')
ylabel('x(t)')
grid;
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Descriptive Statistics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!