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

 Risposta accettata

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);

Più risposte (1)

Stephen23
Stephen23 il 27 Nov 2016
Modificato: Stephen23 il 27 Nov 2016

3 Commenti

I know this way. But I do not want -pi and +pi themselves to be included in the vector.
S = 0.01;
T = S-pi:S:pi-S;
Thank you for your help

Accedi per commentare.

Categorie

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by