finding a specific peak point in a table
古いコメントを表示
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 件のコメント
KSSV
2022 年 7 月 26 日
result = subTable(locs,:);
The above table is empty....check your code properly.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
