How to input vector into a function handle

4 vues (au cours des 30 derniers jours)
Ruby Teja Kusuma
Ruby Teja Kusuma le 31 Août 2021
Commenté : Walter Roberson le 31 Août 2021
i have a function handle fx1=@(x,y,z) x*2+3*y+2z;
and a vector a=[1 2 3].
is there any possible way so that i can input a into fx, without changing a into a cell arrays?
thanks in advance
  5 commentaires
Ruby Teja Kusuma
Ruby Teja Kusuma le 31 Août 2021
yeah this is excatly what im looking for, heavy thanks mate
Walter Roberson
Walter Roberson le 31 Août 2021
If you just happen to be generating the function handle using matlabFunction() in the Symbolic Math Toolbox, then see the 'vars' option: it is possible to arrange that the generated function takes its input from a vector instead of from from individual arguments.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by