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?

 Respuesta aceptada

Matt J
Matt J el 4 de Sept. de 2022
Editada: Matt J el 4 de Sept. de 2022

4 comentarios

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..

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Entering Commands en Centro de ayuda y File Exchange.

Productos

Versión

R2021b

Preguntada:

el 4 de Sept. de 2022

Comentada:

el 4 de Sept. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by