Removing selected data using unique

1 Ansicht (letzte 30 Tage)
Skydriver
Skydriver am 27 Apr. 2019
Kommentiert: Image Analyst am 29 Apr. 2019
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 Kommentar
Star Strider
Star Strider am 27 Apr. 2019
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

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 27 Apr. 2019
Bearbeitet: Image Analyst am 28 Apr. 2019
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 Kommentare
Skydriver
Skydriver am 29 Apr. 2019
Dear Image Analyst
I have done to compute standardize data by implementing limit condition as previous discussed with you. And I added additional information on the path to conduct linier regression. I don't know how to develop the coding for substraction process of ClassY1 until Class Y3 with considering ClassX1 until ClassX3
The next strep is develop interval class to detect outlier (Please focus on Step III-Classified and Step IV-Final) by :
  1. Define = Minimum (X min=4 and Y min=0.3475) and maximum (X max =40 and Y max =24.765) the values in column 1 and coulmn 2
  2. Define interval class by calculating the difference between X max and X is minimal and devided by 3 (three bin of class)
  3. Define limit condition of each class by Class X1 = X min + X mean, Class X2= Class1+X mean and Class X3= Class2 +X mean
  4. Define limit condition of each class by Class Y1 = Y min + Y mean, Class Y2= ClassY1+Y mean and Class Y3= ClassY2 +Y mean.
  5. Calculate the process for detect outlier in basis data by:
  6. a. Class Y1= Substract the value of Column2 (J5-J61) with the limit values of ClassY1 (T7)
  7. b. Class Y2=Substract the value of Column2 (J62-J139) with the limit values of ClassY2(U7)
  8. c. Class Y3=Substract the value of Column2 (J140 - J165) with the limit values of classY3(V7).
  9. Each of classY1, C;ass Y2 and ClassY3, the distribution of data will be limited by ClassX1 for Class Y1, ClassX2 for ClassY2 and Class X3 for Class Y3.
  10. The values of each class is higher than 1 is removed otherwise is compiled. When we removed the value of Column2, the value of column 1 also must be removed. Bcasue Column 1 and Column 2 are pairs of data.
  11. Calculate linier regression
Thx
Image Analyst
Image Analyst am 29 Apr. 2019
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by