フィルターのクリア

How can I find common peak and save it

2 ビュー (過去 30 日間)
Phudit Kanittasut
Phudit Kanittasut 2021 年 4 月 23 日
編集済み: Pratheek Punchathody 2021 年 4 月 26 日
clear
pure_brain = readmatrix('Pure Brain Spectra.csv');
[pks,locsBr] = findpeaks(pure_brain(:,2));
LvBrain = pure_brain(locsBr,2) > 0 ; % Set Threshold = 1E+4
xBrain = 1:size(pure_brain,1);
YBrain = pure_brain(locsBr(LvBrain),2);
%max of each column
YBrain = YBrain .* 100/max(YBrain);
[pks_min,pks_max] = bounds(pks); % Minimum & Maximum Values Of pks
pure_Liver = readmatrix('Pure Liver Spectra.csv');
[pks,locsLiv] = findpeaks(pure_Liver(:,2));
LvLiver = pure_Liver(locsLiv,2) > 0 ; % Set Threshold = 1E+4
xLiver = 1:size(pure_Liver,1);
YLiver = pure_Liver(locsLiv(LvLiver),2);
% max of each column
YLiver = YLiver .* 100/max(YLiver);
figure
plot(xBrain(locsLiv(LvBrain)), YBrain, '.r')
hold on
plot(xLiver(locsLiv(LvLiver)), YLiver, '.b')
hold off
grid
% To find common peaks considering the threshold of 1E+4:
lB = locsBr(LvBrain);
lL = locsLiv(LvLiver);
s = max(length(lB), length(lL));
locsLivNew = [lL; false(s-length(lL),1)];
locsBrNew = [lB; false(s-length(lB),1)];
common = ismember(lB,lL);
From my code I can find the common peak (same x coordinate but different Y), But I want to save it location in form of [ x, lB,lL] in array , I can only know where the common peak occur but I need to open the data to see the Y value.
The first picture show where the common peak occur
and I need to open the data to compare where its exactly X location
  1 件のコメント
Pratheek Punchathody
Pratheek Punchathody 2021 年 4 月 26 日
編集済み: Pratheek Punchathody 2021 年 4 月 26 日
Please refer to this Link for the answer.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeParametric Spectral Estimation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by