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

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Entering Commands에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2022년 9월 4일

댓글:

2022년 9월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by