Removing selected data using unique
1 回表示 (過去 30 日間)
古いコメントを表示
Halo every one,
I have a question baout how to remov selected data base on such parameter. I want to remove the parameter of colom 1 and colom to based on colom 2 and colom 3.
The reuirement is the coloum 1 will be removed if the colom 3 has values coloum 3 <3.0 and column 3>-3.0. The same parameyers also be implemented for clumn 2 based on column 4<3.0 and column 4>-3.0.
Is there any one can help me how to use unique coding to do remove in column 1 and column 2.
Thx
1 件のコメント
Star Strider
2019 年 4 月 27 日
There will be nothing left in the file:
D = load('InpUniqueSandSoil.txt');
[L,H] = bounds(D)
producing:
L =
0.2000 0.3476 -1.9411 -1.4528
H =
47.0000 29.5447 2.6284 2.9843
採用された回答
Image Analyst
2019 年 4 月 27 日
編集済み: Image Analyst
2019 年 4 月 28 日
Try
data = dlmread(filename, ' ');
col1 = data(:, 1);
col2 = data(:, 2);
col3 = data(:, 3);
col4 = data(:, 4);
% coloum 1 will be removed if the colom 3 has values coloum 3 <3.0 and column 3>-3.0.
rowsToDelete = col3 > -3 | col3 < 3;
col1(rowsToDelete) = []; % Method 1: set to null.
% clumn 2 based on column 4<3.0 and column 4>-3.0.
rowsToKeep = col4 <= -3 & col4 >= 3;
col2 = col2(rowsToKeep); % Method 2: extract only the ones you want.
12 件のコメント
Image Analyst
2019 年 4 月 29 日
I really doubt I'll be able to find enough time to carve out of my very busy schedule to delve into this. It doesn't look like a simple 5 minute task. Sorry but good luck. Call Mathworks tech support and they may be able to help.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!