octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave findpeaks called from cellfun gives an error


From: Juan Pablo Carbajal
Subject: Re: Octave findpeaks called from cellfun gives an error
Date: Wed, 29 Jan 2014 19:21:47 +0100

Andrew, please use the bug tracker to report the bug (also keep the
community posted). It will get lost in my inbox.

Could you please check the following loop code, I suspect that the
error has nothing to do with cellfun
C =  num2cell(abs(dCd),1);
H = num2cell(mPH,1);
for i = 1:numel(C)
  [~, locs] = findpeaks(C{i},'minpeakheight',H{i},'minpeakdistance',mPSI);
endfor

Thank you

On Wed, Jan 29, 2014 at 6:58 PM, Andrew Knyazev <address@hidden> wrote:
> Dear Juan Pablo Carbajal,
>
> Thank you for contributing your findpeaks Octave code to the community!
>
> May I have a small request for improvement? It appears that the function
> findpeaks cannot be used from cellfun, as it gives an error, e.g.,:
>
> [~, locs] =
> cellfun(@(x,y)findpeaks(x,'minpeakheight',y,'minpeakdistance',mPSI), ...
>     num2cell(abs(dCd),1),num2cell(mPH,1),'UniformOutput',0);
>
> error: findpeaks: subscript indices must be either positive integers or
> logicals
> error: called from:
> error:
> C:\Octave\Octave3.6.4_gcc4.6.2\share\octave\packages\signal-1.2.1\findpeaks.m
> at line 126, column 5
>
> The above works in MATLAB 2010b
>
> It would be nice if this issue could be fixed in future releases.
>
> Best regards, Andrew
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]