How can I realize the 'ArrayValued' option in my customized function?

I want to write a function that can turn on/off the vectorization option just like in the integral function by adding a 'ArrayValued' option, how do I realize this?

 Réponse acceptée

Matt J
Matt J le 4 Sep 2022
Modifié(e) : Matt J le 4 Sep 2022

4 commentaires

I know arrayfun, my point is how to realize the 'ArrayValued' switch, in a elegant manner.
And I know addParameter, I'm searching for a elegant way to realize the following:
if p.Results.ArrayValued = 'on'
...
elseif p.Results.ArrayValued = 'off'
...
end
There's nothing inelegant about that that I can see, except you would have to do
if p.Results.ArrayValued == "on"
...
elseif p.Results.ArrayValued = "off"
...
end
ok thank you!
That's a load off my mind..

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Entering Commands dans Centre d'aide et File Exchange

Produits

Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by