passing arguments to a function
Show older comments
function val = sum(a,b)
default('a',1); % uses a function from file exchange
default('b',20);
val = a+b
end
I want to pass only the second argument and use the default for first,a. Something like below,
val = sum(b=2)
How can I do this in MATLAB?
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Environment Customization 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!