hasarg

Check if a specific value/argument pair exists in varargin/cellstring
133 Downloads
Updated 2 Mar 2012

View License

Check if a specific value/argument pair exists in varargin/cellstring.

args= { 'option1', true, 'option2', [1 2 3] };

%returns true
exists = hasarg( args, 'option1' );

Cite As

Ivar Eskerud Smith (2024). hasarg (https://www.mathworks.com/matlabcentral/fileexchange/35416-hasarg), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Argument Definitions in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0