buzsakilab / buzcode

Code for internal lab sharing - polishing has started but is by no means complete
http://www.buzsakilab.com/
GNU General Public License v3.0
119 stars 129 forks source link

Error while using "bz_PowerSpectrumSlope" #414

Closed farazmoradi closed 2 years ago

farazmoradi commented 2 years ago

Hi, I have received this error while running this function:

My Code: [specslope,spec] = bz_PowerSpectrumSlope(lfp,2,1,'frange',[4 100]);

Error:

Attempt to execute SCRIPT FindInInterval as a function: /Volumes/Project/Nastaran Project/Buzsaki/buzcode-master/externalPackages/FMAToolbox/General/FindInInterval.m

Error in InIntervals (line 129) more = FindInInterval(values,[from to],previous);

Error in bz_PowerSpectrumSlope (line 145) keeptimes = InIntervals(spec.timestamps,ints);

dlevenstein commented 2 years ago

Hm. The error says: "Attempt to execute SCRIPT FindInInterval as a function" However, FindInInterval should be a compiled c function, not a script.

Did you compileBuzcode?

farazmoradi commented 2 years ago

No! I did it right now!

Error using mex /Volumes/Project/Nastaran Project/Buzsaki/buzcode-master/analysis/spikes/correlation/CCGHeart.c:1:16: warning: '/' within block comment [-Wcomment] / CCGEngine.c / ^ /Volumes/Project/Nastaran Project/Buzsaki/buzcode-master/analysis/spikes/correlation/CCGHeart.c:2:1: warning: '/' within block comment [-Wcomment] / This is a bare-bones C program whos purpose is to compute ^ /Volumes/Project/Nastaran Project/Buzsaki/buzcode-master/analysis/spikes/correlation/CCGHeart.c:195:3: error: implicitly declaring library function 'memcpy' with type 'void (void , const void , unsigned long)' [-Werror,-Wimplicit-function-declaration] memcpy(mxGetPr(plhs[1]), (void )Pairs, PairCntsizeof(unsigned int)); ^ /Volumes/Project/Nastaran Project/Buzsaki/buzcode-master/analysis/spikes/correlation/CCGHeart.c:195:3: note: include the header or explicitly provide a declaration for 'memcpy' 2 warnings and 1 error generated.

Error in compileBuzcode (line 37) mex -O CCGHeart.c

dlevenstein commented 2 years ago

This sounds like an issue with your c compiler? check out #410, if you're not going to use the CCG function you can comment out line 37 of compileBuzcode with no problems

farazmoradi commented 2 years ago

Solved. Thank you very much!

dlevenstein commented 2 years ago

No problemo!