finding a specific peak point in a table
Afficher commentaires plus anciens
Hello,
attached is a table of data where we are intrested in locating the peak point according to a certain criteria,
- it should be located within a range of 200-700 for the variable GDALT
- It is the first peak that is found in that interval
to do that I am applying the folling lines
profileTable.INDEX = (1:height(profileTable))';
subTable = profileTable(((profileTable.GDALT>=200) & (profileTable.GDALT<=700)), :);
[pks,locs] = findpeaks(subTable.NE8);
result = subTable(locs,:);
x = profileTable.NE8 ;
y = profileTable.GDALT ;
peak_y = profileTable.GDALT(result.INDEX(1)) ;
peak_x = profileTable.NE8(result.INDEX(1)) ;
idx = y <= peak_y ;
But I am getting the following error
Index exceeds the number of array elements. Index must not exceed 0.
Error in tabular/dotParenReference (line 114)
b = b(rowIndices);
Error in PeakConstruction (line 94)
peak_y = profileTable.GDALT(result.INDEX(1)) ;
I am attaching the table "profileTable" where I am getting the error, and another table 'profileTable2' where the code is running fine.
1 commentaire
KSSV
le 26 Juil 2022
result = subTable(locs,:);
The above table is empty....check your code properly.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Signal Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
