How to get a sum of a series
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
dav
am 20 Feb. 2014
Beantwortet: Muruganandham Subramanian
am 20 Feb. 2014
Hello,
I need to get the sum of
Y(t)= A(i)*X(t-i)
where X is a vector of size (100,1). A is a vector of size (3,1)
i=0 to 2 and t= 3 to 100.
Any help is greatly appreciated.
Thanks
Dav
0 Kommentare
Akzeptierte Antwort
kjetil87
am 20 Feb. 2014
t = 3:100;
sumY=0;
for i=0:2
sumY = sumY+sum(A(1+i)*X(t-i)) ;
end
like this?
0 Kommentare
Weitere Antworten (2)
David Young
am 20 Feb. 2014
Bearbeitet: David Young
am 20 Feb. 2014
If you want the sum over i for each t, then it's
Y = conv(X, A, 'valid');
0 Kommentare
Siehe auch
Kategorien
Mehr zu Assembly finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!