It's apparently a matlab function that only exists in newer versions of matlab. I'm using Matlab 7.3 and I don't have it; www indicates newest version of matlab with it is R2007a. It seems to be used in a few places in the newest release of SPM8:
$ find . -name "*.m" -exec grep bsxfun {} +
./spm_detrend.m: y = bsxfun(@minus, x, mean(x));
./external/fieldtrip/preproc/ft_preproc_baselinecorrect.m:persistent hasbsxfun
./external/fieldtrip/preproc/ft_preproc_baselinecorrect.m:if isempty(hasbsxfun)
./external/fieldtrip/preproc/ft_preproc_baselinecorrect.m: hasbsxfun = exist('bsxfun', 'builtin')==5;
./external/fieldtrip/preproc/ft_preproc_baselinecorrect.m:if hasbsxfun
./external/fieldtrip/preproc/ft_preproc_baselinecorrect.m: dat = bsxfun(@minus,dat,baseline);
./external/fieldtrip/ft_denoise_pca.m:persistent bsxfun_exists;
./external/fieldtrip/ft_denoise_pca.m:if isempty(bsxfun_exists);
./external/fieldtrip/ft_denoise_pca.m: bsxfun_exists=(exist('bsxfun')==5);
./external/fieldtrip/ft_denoise_pca.m: if ~bsxfun_exists;
./external/fieldtrip/ft_denoise_pca.m: error('bsxfun not found.');
./external/fieldtrip/ft_denoise_pca.m:y = cellfun(@bsxfun, repmat({@plus}, nx), x, v, 'UniformOutput', 0);
./external/fieldtrip/ft_denoise_pca.m:persistent bsxfun_exists;
./external/fieldtrip/ft_denoise_pca.m:if isempty(bsxfun_exists);
./external/fieldtrip/ft_denoise_pca.m: bsxfun_exists=(exist('bsxfun')==5);
./external/fieldtrip/ft_denoise_pca.m: if ~bsxfun_exists;
./external/fieldtrip/ft_denoise_pca.m: error('bsxfun not found.');
./external/fieldtrip/ft_denoise_pca.m:y = cellfun(@bsxfun, repmat({@times}, nx), x, v, 'UniformOutput', 0);
./external/fieldtrip/forward/ft_headmodel_halfspace.m:X = bsxfun(@minus,X,P);
./spm_searchlight.m:clique = bsxfun(@minus, clique, c);
./spm_searchlight.m: xyz = bsxfun(@plus,XYZ(:,i),clique);
./spm_searchlight.m: xyz(:,any(bsxfun(@lt,xyz,[1 1 1]') | bsxfun(@gt,xyz,DIM'))) = [];
./spm_searchlight.m: idx = bsxfun(@plus, idx(:), 0:k:k*N-1);
./spm_searchlight.m: idx = bsxfun(@plus, idx(:), 0:prod(DIM):NDIM-1);
WWW makes it seem like you can download replacements for this function, but they involve using MEX files that you have to compile. I assume but am not sure that another possibility is to replace each occurance of the "general" bsxfun with something that only performs the task indicated by the function pointer argument in that particular invocation of bsxfun.
|