Array indexing and processing
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Star Strider
2015-2-14
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
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Performance and Memory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!