Array slice indexing?
276 次查看(过去 30 天)
显示 更早的评论
Hey
please explain what the following function does :
y=a(i,end:-1:1);
if you could give me an example that would be great! thank you
0 个评论
回答(2 个)
the cyclist
2017-11-13
编辑:the cyclist
2017-11-13
It returns the ith row of a, in right-to-left order.
0 个评论
Mohammed Hamaidi
2022-3-22
Take for example:
a=[1 2 3; 5 6 7; 8 9 12]
and
i=2
then
a(i,end:-1:1)
gives: the 2nd row in right to left order (the elements of the 2nd row from right to left)
ie: 7 6 5
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!