extracting 20% of the data from a table

3 views (last 30 days)
i have the following data table that represents the curve that is is shown in the plot, at row number 9 in this table we have the peak point, th max point for the variable NE8, we would like to split our table in a way such that we extract 20% of the data points we have above the peak and 20% of the data below the peak and the peak point from that table? is there an easy way that would allow us to do that ?
thanks in advance

Accepted Answer

KSSV on 14 Jun 2022
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1031740/testProfile.txt') ;
x = T.NE ;
y = T.GDALT ;
peak_y = T.GDALT(9) ;
peak_x = T.NE(9) ;
% idx = y <= peak_y ;
idx = x <= peak_x ;
legend('Curve','below peak','above peak')

More Answers (0)


Find more on Tables in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!