I am trying to plot the follwing sequence,
?(?) = ?[?(?) − ?(? − 10)]+ 10? −0.(?−10) [?(? −10) − ?(? − 20)]
Over this interval
0 ≤ ? ≤ 20
I already have some code from a previous attempt at this type of problem which is as follows,
% USMPL Function %
function delta = usmpl(n)if n == 1 delta = 1else delta = 0end% Main Code %
n = -10:10x = zeros(length(n) for k = 1:length(n) x(k) = 2*usmpl(n(k)+ 1) - usmpl(n(k)-6);endstem(n,x)
The problem I am having is working out what to put where in this code to make it work for this problem.
Thanks.
Best Answer