[英]3D volume indexing to get arbitrary vectors matlab
I have a 3D volume and a list of x,y
coordinates. 我有一个3D体积和一个x,y
坐标列表。 I need to extract from the volume all vectors 我需要从体积中提取所有向量
V(x,y,:)
turned x,y
to linear index but I cannot use: 将x,y
为线性索引,但是我不能使用:
V(ind,:)
because Matlab assumes that ind
is a subscript and I get an error (index exceeded...). 因为Matlab假设ind
是下标,并且出现错误(索引已超出...)。 It's OK to use V(:,ind)
but that's not what I need. 可以使用V(:,ind)
但这不是我所需要的。
Any way of doing this without repmat
on the 3rd dimension and use linear index on all three dimensions? 有没有办法在第三个维度上没有repmat
并在所有三个维度上都使用线性索引? I want to avoid this, because the volume is very large. 我想避免这种情况,因为体积很大。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.