フィルターのクリア

Deleting specific values from multidimensional matrix

1 回表示 (過去 30 日間)
okoth ochola
okoth ochola 2022 年 6 月 12 日
回答済み: Image Analyst 2022 年 6 月 12 日
I have a huge data which can be repersented as matrix of dimenson 34000 by 2. I would like to delete some rows that contains undesirable value(outliers). How can I go about this? Kindly assist, thank you

採用された回答

Image Analyst
Image Analyst 2022 年 6 月 12 日
That's far from huge. Anyway, determine which rows need to be deleted and then set those rows to null. For example if the undesireable rows are where the first column has negative numbers then do this
rowsToBeDeleted = data(:, 1) < 0;
data(rowsToBeDeleted, :) = []; % Set to null to remove the entire row.
Or, equivalently you could do
goodRows = data(:, 1) > 0;
data = data(goodRows, :); % Extract only the good rows.
Please invest 2 hours in the basics and it will save you time:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by