I am trying to run this code:
for i=1:numel(locs1) peak_1q{i}=findpeaks(Qxy(:,numel(locs1)));end;
I am getting this error:
Cell contents assignment to a non-cell array object.Error in T_5Dec4 (line 52) peak_1q{i}=findpeaks(Qxy(:,numel(locs1)))
I need to store the value in a cell array,each column may have more than 1 peak .If I store it in a matrix (preallocated before the for loop,I get only the peaks for the last iteration of the loop. if I use
peak_1q(i)=findpeaks(Qxy(:,numel(locs1)))
I get this error:
In an assignment A(:) = B, the number of elements in A and B must be the same.Error in T_5Dec4 (line 53) peak_1q(i)=findpeaks(Qxy(:,numel(locs1)))
Any suggestions? How do I find and store the peaks from each column of the given data?
Best Answer