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?

 Accepted Answer

Matt J
Matt J on 4 Sep 2022
Edited: Matt J on 4 Sep 2022

4 Comments

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

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2021b

Community Treasure Hunt

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

Start Hunting!