Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个A维度矩阵,Nx3其中N行数。A存储坐标 x,y,z。现在假设我已经有一组已知坐标 B = [x' y' z'] 我想在其中查找A。我想找出A商店中哪个行索引的数量(x',y',z')。我怎样才能做到这一点?我想我将不得不使用find()
A
Nx3
N
find()
find例如,您可以使用
find
find(A(:,1)==B(1) & A(:,2)==B(2) & A(:,3)==B(3))
将产生匹配的行\行的索引。
试着习惯阅读 Matlab 的文档,它就在那里……
顺便说一句,另一种方法是使用ismember:
ismember
[~,id]=ismember(B,A,'rows')
该变量id将产生B匹配的行的索引A。
id
B