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

 Respuesta aceptada

Image Analyst
Image Analyst el 27 de Nov. de 2016
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);

Más respuestas (1)

Stephen23
Stephen23 el 27 de Nov. de 2016
Editada: Stephen23 el 27 de Nov. de 2016

3 comentarios

Somaya Alaa
Somaya Alaa el 27 de Nov. de 2016
I know this way. But I do not want -pi and +pi themselves to be included in the vector.
Stephen23
Stephen23 el 27 de Nov. de 2016
Editada: Stephen23 el 27 de Nov. de 2016
S = 0.01;
T = S-pi:S:pi-S;
Somaya Alaa
Somaya Alaa el 27 de Nov. de 2016
Thank you for your help

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de Nov. de 2016

Respondida:

el 27 de Nov. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by