Hi there,
I was wondering if someone could help explain what the following line of matlab code is doing -
R = H(npt-1:-1:2);
Where H is a vector (or 1 * 513 matrix) of complex numbers.
Thanks for any tips

 채택된 답변

Star Strider
Star Strider 2015년 2월 14일

0 개 추천

That line assigns to ‘R’ values of ‘H’ using index references starting at ‘npt-1’, decrementing by 1 to ‘H(2)’.
For instance:
H = [1:10];
npt = 10;
R = H(npt-1:-1:2)
‘R’ is assigned:
R =
9 8 7 6 5 4 3 2

추가 답변 (1개)

Gilbert S
Gilbert S 2015년 2월 14일

0 개 추천

Perfect, thank you! My Matlab is rusty, so coming from a C background, things like this can slow me down..!
Thanks for your help..

카테고리

도움말 센터File Exchange에서 Performance and Memory에 대해 자세히 알아보기

태그

질문:

2015년 2월 14일

댓글:

2015년 2월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by