4 Kommentare

John D'Errico
John D'Errico am 18 Dez. 2016
With a loop? Note that variables in MATLAB cannot be indexed with negative numbers.
mohamed enan
mohamed enan am 18 Dez. 2016
Bearbeitet: John Kelly am 10 Nov. 2017
with a loop or symsum anything that makes this work
John BG
John BG am 19 Dez. 2016
Mohamed are you calculating DTFT coefficients?
the[-3:1:3] window is shifting isn't it?
can you supply the whole chain of ak coefficients?
John BG
John BG am 19 Dez. 2016
Dear Mr D'Errico
YES
in MATLAB the index to matrices cannot be 0 or negative, .
BUT .
NO,
you can build an index vector to make the k shift along any desired values, so ONE can use negative indices, not directly, but just check what the Image Analyst wrote below.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 18 Dez. 2016

0 Stimmen

Perhaps this:
j = sqrt(-1)
a = rand(1,7); % Whatever...
omega = 2 % Whatever....
t = 42; % Whatever t value you want to evaluate x at.
k = -3 : 3;
x = sum(a .* exp(j .* k .* omega * t))

2 Kommentare

Jan
Jan am 18 Dez. 2016
I think 1j is nicer than redefining j=sqrt(-1).
Image Analyst
Image Analyst am 19 Dez. 2016
You're right. That's a nice shortcut (if one remembers it).

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 18 Dez. 2016

Bearbeitet:

am 10 Nov. 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by