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

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;
Thank you for your help

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrices 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