Continuous signal, Can anyone help me?
3 views (last 30 days)
Show older comments
Continuous signal. The signal must be a sum of steps and the user to choose the number of steps and each step also defines the initial time and amplitude, as follows. x (t) = a1u(t-t1)+a2u(t-t2) + …
Can anyone help me
0 Comments
Accepted Answer
Azzi Abdelmalek
on 2 Nov 2013
t=0:0.01:10
a1=1;
a2=4;
t1=1;
t2=3;
y=a1*heaviside(t-t1)+a2*heaviside(t-t2)
plot(t,y)
11 Comments
Azzi Abdelmalek
on 2 Nov 2013
Try this one, simple to understand
t=0:0.01:100
Deg=input('Input number:\n');
out=zeros(1,numel(t));
for x = 1:Deg
a(x)=input('input amplitude:\n');
i(x)=input('input initial time:\n');
out=out+a(x)*heaviside(t-i(x))
end
plot(t,out)
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!