use*_*021 3 arrays sorting matlab
我有一系列数据.为简单起见,我们称之为4 x 3矩阵.假设我想在第2列中找到一个值为5的数据点.然后,我想在第2列中获取包含值5的所有行,并将其放在自己的数组中.我的数据比下面显示的数据大得多,所以我不想通过眼睛看看每一行数据并识别所有5个数据.
% My idea of the code:
data = [1 2 3 4; 5 5 5 6; 6 4 5 6]
if data(:,2) == 5
% This is the part I can't figure out
end
Run Code Online (Sandbox Code Playgroud)
让我们将最终数据称为将存储带有5的数据的数组.我该怎么做呢?