problemas con estos ciclos for
Publicado por Israel Jarely (1 intervención) el 11/10/2017 18:53:06
Tengo el siguiente codigo para realizar una recuperacion de una señal cosenoidal pero al tratar de compilarlo me vota el siguiente error:" in an assignment a(:) = b, the number of elements in a and b must be the same."
CODIGO:
Apreciaria mucho su ayuda por favor!!!!!!
CODIGO:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
t = 0:0.02:36
y = cos(pi*t/4)
plot(t,y)
Ts = 4
N = 10
Xn =[1,-1,1,-1,1-1,1,-1,1,-1]
Tn =[0,4,8,12,16,20,24,28,32,36]
for ti=1:181
Xr(ti)=0;
for n=1:N
Xr(ti) = Xr(ti) + Xn*sinc(t(ti)-Tn(n)/Ts)
end
end
plot(t,Xr)
hold on
plot(t,y)
Valora esta pregunta
0