How can I index a 3D array like A(n,m,:) and get the result as a 1D array?
26 次查看(过去 30 天)
显示 更早的评论
Hi
Assume we have a 3D array like this (image from the manual):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/362005/image.gif)
In python/numpy I can something similar to
B = A(2,3,:)
which gets me B as a 1D array with: B = [A(2,3,1), A(2,3,2) , A(2,3,3)]
Can I do something similar (as simple) in matlab without going to e.g. linear indexing?
3 个评论
采纳的回答
更多回答(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!