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?

 採用された回答

Matt J
Matt J 2022 年 9 月 4 日
編集済み: Matt J 2022 年 9 月 4 日

0 投票

4 件のコメント

Tian Xing Who
Tian Xing Who 2022 年 9 月 4 日
I know arrayfun, my point is how to realize the 'ArrayValued' switch, in a elegant manner.
Tian Xing Who
Tian Xing Who 2022 年 9 月 4 日
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
Matt J
Matt J 2022 年 9 月 4 日
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
Tian Xing Who
Tian Xing Who 2022 年 9 月 4 日
ok thank you!
That's a load off my mind..

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

製品

リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by