'/' used for creating an axis, DFT

2 ビュー (過去 30 日間)
sprklspring
sprklspring 2017 年 10 月 27 日
回答済み: Steven Lord 2017 年 10 月 27 日
How does building an axis in that way: 'freq= [-pi+pi/L:2*pi/L:pi-pi/L];' work exactly? Why so many '/' signs and what do they exactly do? DFT

採用された回答

Star Strider
Star Strider 2017 年 10 月 27 日
This assignment:
freq = [-pi+pi/L:2*pi/L:pi-pi/L];
is apparently for a two-sided Fourier transform, where ‘L’ is the length of the Fourier transform vector. The increment of the vector is ‘pi/L’, where the ‘/’ is right division (specifically, ‘matrix right division’, see the mrdivide (link) documentation for details). The vector goes from ( -pi + the increment ) to ( pi - the increment ). Supply an integer value for ‘L’ and run that line to see how it works.

その他の回答 (1 件)

Steven Lord
Steven Lord 2017 年 10 月 27 日
The / operator performs division.
>> x = 1/3
x =
0.333333333333333
The colon operator : creates a vector.
>> from1To7InStepsOf2 = 1:2:7
from1To7InStepsOf2 =
1 3 5 7

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by