I'm using Armadillo C++ library for matrices.

I have a 3d matrix (Cube) of size [73 256 1000].

I would like to take only part of the rows of the cube, e.g. in matlab

A = A(3:66, :, :);

How can I do it with Armadillo? I haven't found anything in the API.

Thanks.

有帮助吗?

解决方案

The functionality is listed in Armadillo's documentation, in the subcube views section. You can use span::all to indicate an entire range. to For example:

cube A(100,50,10);
A.randu();

A = A(span(3,66), span::all, span::all);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top