Hi, Can anyone tell me how can i plot evenly spaced angles in a matrix form. Matrix is of N*M size
5 views (last 30 days)
Show older comments
I want my output to be a vector as shown in diagram.
0 Comments
Answers (1)
Akira Agata
on 22 Sep 2017
I believe the following would be a solution to generate your matrix S.
N = 4;
M = 8;
phiDelta = 2*pi/M;
S = [];
for k = 1:N;
kthRow = exp(i*(k-1)*phiDelta*(0:N-1));
S = [S; kthRow];
end
1 Comment
Walter Roberson
on 22 Sep 2017
That could be vectorized:
N = 4;
M = 8;
phiDelta = 2*pi/M;
k = 1:N;
S = exp( bsxfun( @times, phiDelta * 1i * (k-1).', 0:N-1) )
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!