hasarg

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

You are now following this Submission

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 (2026). hasarg (https://www.mathworks.com/matlabcentral/fileexchange/35416-hasarg), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0