How to get a handle to an overriden built-in function? -
this question has answer here:
- how unhide overriden function? 1 answer
on matlab path there's custom zeros
function. want store handle built-in zeros
in variable. how can that?
thought @(varargin)builtin('zeros',varargin{:})
, slow down operation due string comparison.
also, i've noticed it's possible refer diag
@numel\diag
, doesn't seem work other built-in functions (zeros
in particular).
well, doesn't give exact answer question, solve problem:
i think seems solution:
matlabcentral: how call shadowed function
withn last post:
just stumbled upon problem , found following solution: example, have matlab svmtrain shadowed libsvm toolbox:
which svmtrain -all
c:\projects\ichilov\misc\mvpa\libsvm-mat-3.0-1\svmtrain.mexw64
c:\program files\matlab\r2009b\toolbox\bioinfo\biolearning\svmtrain.m % shadowed
but can access original function using str2func:
org_svmtrain = str2func([matlabroot '\toolbox\bioinfo\biolearning\svmtrain'])
and calling:
org_svmtrain(training, groupnames)
Comments
Post a Comment