How to get a handle to an overriden built-in function? -


this question has answer here:

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

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -