www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ExtraParameterValueInputsExample.m

    %% Extra Parameter Value Inputs  
% Store parameter name and value inputs that are not in the input scheme
% instead of throwing an error.   

% Copyright 2015 The MathWorks, Inc.


%%  
default = 0;
value = 1;

p = inputParser;
p.KeepUnmatched = true;
addOptional(p,'expectedInputName',default)
parse(p,'extraInput',value); 

%% 
% View the unmatched parameter name and value: 
p.Unmatched