How to set mutually exclusive arguments in matlab?
Show older comments
How to use the new "arguments" parameter qualifier to control mutually exclusive two(or more) parameters as function inputs?
for example:
function out = twoStats(x,y)
arguments
% If you have input x, you cannot input y
% If you have input y, you cannot input x
end
end
similar question:
1 Comment
Jon
on 16 Nov 2020
I have been looking through the documentation. It appears that the input validation only operates on a single argument at a time. I don't see any mechnisim for making the validation of one input dependent upon another, e.g. must be empty if b is not empty. Obviously you could check this yourself, but I understand that you want to use the new argument feature to do this
Accepted Answer
More Answers (0)
Categories
Find more on Modulation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!