How to delete certain values below a function/plot?

4 次查看(过去 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.

采纳的回答

Jonas
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 个评论
Markus Vietze
Markus Vietze 2021-7-9
Hey, thank you for this answer. Its working.
But I got two problems with it:
  1. I dont want to delete my rows filled with 999, because they are used for different function.
  2. I have to delete all rows, which include the deleted cells.
May you have a idea for this as well? Would help me a lot!
Thanks!
Peter Perkins
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 CenterFile Exchange 中查找有关 Data Type Identification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by