Back to the main page.

Bug 714 - make a mex implementation of nanmean, nanvar etc

Status CLOSED FIXED
Reported 2011-05-29 14:19:00 +0200
Modified 2011-10-05 15:07:15 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Jan-Mathijs Schoffelen - 2011-05-29 14:19:59 +0200

to overload the functions in the stat toolbox, and make the implementation more memory efficient than the existing overloaded functions


Jan-Mathijs Schoffelen - 2011-08-13 18:26:00 +0200

@jörn: would it be a big deal for you to mex'ify src/nanmean.c src/nanvar.c src/nansum.c and src/nanstd.c for windows? The mex-files need to go into: private/: nanmean nanstd nanvar nansum fileio/private: nanmean utilities/private: nanmean statfun/private: nanmean nanstd nanvar Thanks


Jan-Mathijs Schoffelen - 2011-08-31 12:49:43 +0200

@jörn: would it be a big deal for you to mex'ify src/nanmean.c src/nanvar.c src/nansum.c and src/nanstd.c for windows? The mex-files need to go into: private/: nanmean nanstd nanvar nansum fileio/private: nanmean utilities/private: nanmean statfun/private: nanmean nanstd nanvar connectivity/private: nansum


Jörn M. Horschig - 2011-08-31 12:55:14 +0200

yep, it is ;) nanmean.c nanmean.c(39) : error C2124: divide or mod by zero nanmean.c(49) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data nanmean.c(53) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data nanmean.c(149) : warning C4013: 'isnan' undefined; assuming extern returning int nanmean.c(232) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data nanmean.c(255) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Compile of 'nanmean.c' failed. ??? Error using ==> mex at 208 Unable to complete successfully. I get the same error for all nanXXX.c


Jörn M. Horschig - 2011-08-31 14:14:26 +0200

http://stackoverflow.com/questions/1923837/how-to-use-nan-and-inf-in-c dunno if that helps ;)