How to delete certain values below a function/plot?
3 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to delete all values out of a table, which are below values of another table. (The files are attached)
The problem is that my comparison data (SN1520) is in 5° increments, but my measurement data (AWL) is unordered (Only the values of the 2nd and 4th column are important for that). Now I want to clean up the measurement data based on my comparison data, i.e. delete the values in the 4th column of AWL if they are too bad for the value in the 2nd column. Too bad means that they are below the values of SN1520.
So I have tried to plot the SN1520 data and create a function from it:
SN = readtable('SN1520.csv')
figure;
x = SN{:,1};
y = SN{:,2};
plot(x,y);
title('Dependency GPS Elevation');
xlabel('Elevation');
ylabel('GPS');
%Function out of Basis Fitting -> Cubic
gps = 2.03990368077056e-05*x.^3-0.00503162317558603*x.^2+0.466151899356234*x+34.8353383458647;
Now I want to clean up the measurement data using this function so that only good data is available, i.e. values that lie above the function.
I know how to delete the values in each line, but I can't find any code that selects all the data under the function/plot.
1 件のコメント
KSSV
2021 年 7 月 8 日
If A is matrix and you want to remove all the rows given with indices idx;
A(idx,:) = []
採用された回答
Jonas
2021 年 7 月 8 日
do you mean you want to remove every y hat is smaller than gps?
x(y<=gps)=[];
y(y<=gps)=[];
plot(x,y);
4 件のコメント
Peter Perkins
2021 年 7 月 28 日
Probably not doing yourself a favor by using readmatrix and all those table2array calls. Read the data as tables, when you need to use thing sin them use dot subscripting, like SN1520.Elevation, SN1520.GPS, AWL.Elevation, and AWL.S_dbHz_. Your code will be much more readable.
If you really want to pull things out of your tables,
Angle=table2array(B(:,3));
is not the best way.
Angle = B.Elevation;
is preferred.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!