Aaaaaaaaaaa
Aaaaaaaaaaa
Aaaaaaaaaaa
clear all
close all
q=input('Ingrese el numero de muestras: ');
n=-1:q-2;
y(1)=2;
a=1;
for i=2:length(n)+1
if a>=2
y(i)=-0.5*y(i-1)+(0.5^(a-1))-(0.5^(a-2));
a=a+1;
elseif a==1;
y(i)=-0.5*y(1)+(0.5^(a-1));
a=a+1;
end
end
n=-1:q-1;
stem(n,y);