我试图给有峰的XRD数据贴上标签,我想从我的一系列数据中给它贴上标签:
peak label
ab
ac
ad
cb
bb
ba见下图

我也希望那些标签垂直对齐在顶部的峰值。我尝试了findpeaks函数,但它不起作用。
发布于 2015-02-25 06:58:18
试试这个(但是您需要有一个信号处理工具箱):
x = [1 2 3 4 5 6 7 8 9]
y = [1 4 2 7 3 9 5 10 2]
[peak, peakId] = findpeaks(y); %find peaks in your serie
figure(1)
plot(x, y)
lbalph=('a':'z').'
lb=strcat(Alphabet(1),lbalph(1:length(peak))) %Create a label matrix
lb = num2cell(lb,2) % Convert to cell array
lbid = 1:length(lb)
text(x(peakId), peak, lb(lbid),'Rotation',90) % label the peak with your lb matrix

因为你有指数峰值,你可以标记你想要的。
https://stackoverflow.com/questions/28712464
复制相似问题