MATLAB: Labelling peaks on a graph MATLAB I have a plot which contains many peaks(as peaks in a spectrum). I want to label some of these peaks as 'xyz', 'amc' etc. What should i do? Best Answer Use the findpeaks (link) or islocalmax (link) function, and the text (link) function. Related SolutionsMATLAB: Correlation between two row matrices Like that, each value of "a" is correlated to each value of "b", but applying the formula of the correlation, the correlation of two single numbers is NaN. To compute the correlation correctly, traspose the input vectorsresult = corr(a', b'); MATLAB: Help with removing duplicate sub-elements…. Use isnan and diff to create some indices, then replace those values:>> A = [-2 -2 -2 -2 NaN NaN NaN -3 -3 -3 -3 NaN NaN -2 -2 -2 NaN -3 -3 NaN NaN 1 1 1 1 NaN NaN 4 4 4 NaN NaN 3 3 3 NaN]A = -2 -2 -2 -2 NaN NaN NaN -3 -3 -3 -3 NaN NaN -2 -2 -2 NaN -3 -3 NaN NaN 1 1 1 1 NaN NaN 4 4 4 NaN NaN 3 3 3 NaN>> B = A;>> B(-1<diff(isnan([NaN,A]))) = NaNB = -2 NaN NaN NaN NaN NaN NaN -3 NaN NaN NaN NaN NaN -2 NaN NaN NaN -3 NaN NaN NaN 1 NaN NaN NaN NaN NaN 4 NaN NaN NaN NaN 3 NaN NaN NaN Related QuestionHistogram PeakSubtract two matrices each with NaN values in different cellsFind peaks.
Best Answer