How can I create vector for values in the range -π < θ < π ?

 採用された回答

Image Analyst
Image Analyst 2016 年 11 月 27 日

1 投票

You can use linspace() to specify the number of elements you want:
margin = 0.0001; % Whatever you want. How close to pi you want to allow.
numElements= 1000; % Whatever you want. How many elements in your vector.
theta = linspace(-pi + margin, pi - margin, numElements);

その他の回答 (1 件)

Stephen23
Stephen23 2016 年 11 月 27 日
編集済み: Stephen23 2016 年 11 月 27 日

3 投票

3 件のコメント

Somaya Alaa
Somaya Alaa 2016 年 11 月 27 日
I know this way. But I do not want -pi and +pi themselves to be included in the vector.
Stephen23
Stephen23 2016 年 11 月 27 日
編集済み: Stephen23 2016 年 11 月 27 日
S = 0.01;
T = S-pi:S:pi-S;
Somaya Alaa
Somaya Alaa 2016 年 11 月 27 日
Thank you for your help

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMatrices and Arrays についてさらに検索

タグ

質問済み:

2016 年 11 月 27 日

回答済み:

2016 年 11 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by