Effacer les filtres
Effacer les filtres

Using feval on varying set of arguments

1 vue (au cours des 30 derniers jours)
Deepayan Bhadra
Deepayan Bhadra le 3 Mar 2018
I'm using feval inside a function check_gradient. The setting is like this:
function iscorrect = check_gradient(f,grad,x0)
and feval as: feval(f,x0+del)-feval(f,x0).
But the thing is sometimes, I want to use feval inside my function check_gradient as
function iscorrect = check_gradient(f,grad,x0,b,mu,eps)
feval(f,x0+del,b,mu,eps)-feval(f,x0,b,mu,eps)
(I'm defining function handles 'f' that can take a varying number of arguments)
How do I factor in all such cases without defining a separate check_gradient function for each case?
Thanks a lot.

Réponses (0)

Catégories

En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by