Warning about non integer index

Hi,

In order to get rid of an annoying warning message (Warning: Integer operands are required for colon operator when used as index), I think the following code (process_evt_detect.m, line 341-347):

       % ignore the first and last 5% of the signal (incase of artifacts)
        Fsig = Fsig(length(Fsig)*0.05:end-(length(Fsig)*0.05));
        stdF = std(Fsig);
    else
        Fsig = F;
        Fsig = Fsig(length(Fsig)*0.05:end-(length(Fsig)*0.05));
        stdF = std(Fsig);

should be updated to

       % ignore the first and last 5% of the signal (incase of artifacts)
        Fsig = Fsig(round(length(Fsig)*0.05):end-round(length(Fsig)*0.05));
        stdF = std(Fsig);
    else
        Fsig = F;
        Fsig = Fsig(round(length(Fsig)*0.05):end-rounf(length(Fsig)*0.05));
        stdF = std(Fsig);

Best,

Christian

Hi Christian,

I replaced the lines you’re mentioning with:

    % Remove the bad bad segments from the signal (if any)
    if ~isempty(Fmask)
        Fsig = F(Fmask);
    else
        Fsig = F;
    end
    % Ignore the first and last 5% of the signal (in case of artifacts)
    nIgnore = round(size(Fsig,1) * 0.05) + 1;
    Fsig = Fsig(nIgnore:end-nIgnore+1);
    % Compute standard deviation
    stdF = std(Fsig);

Thanks for reporting this.
Francois