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.
我在 Matlab 中做了一个模拟,输出一个矩阵。因此,经过 500 次运行后,我将拥有 500 个矩阵。如何从这些矩阵中选择某一行?行是[xxx 1 0 0 0],其中 xxx表示从一个矩阵到另一个矩阵不同的现有数字。
[xxx 1 0 0 0]
xxx
你可以用ismember这个
ismember
idxL = ismember(bigMatrix,[25,1,0,0],'rows');
idxL是一个逻辑向量,其中的行bigMatrix等于目标行值,否则为零。您可以使用它来索引其他数组。如果您需要行号,请使用rowNumbers = find(idxL).
idxL
bigMatrix
rowNumbers = find(idxL)