How to delete certain values below a function/plot?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Markus Vietze
el 8 de Jul. de 2021
Comentada: Peter Perkins
el 28 de Jul. de 2021
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 comentario
KSSV
el 8 de Jul. de 2021
If A is matrix and you want to remove all the rows given with indices idx;
A(idx,:) = []
Respuesta aceptada
Jonas
el 8 de Jul. de 2021
do you mean you want to remove every y hat is smaller than gps?
x(y<=gps)=[];
y(y<=gps)=[];
plot(x,y);
4 comentarios
Peter Perkins
el 28 de Jul. de 2021
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!