validateInput

A simple 'getOpts' type script to validate input parameters.

您现在正在关注此提交

validateInput started when creating saveppt2. There was a need to take a large number of inputs, in any order, and make them usable to the script. Checking if an input argument has been passed can be done with isfield or if the 'force' option is enabled if the field is false.

Examples:
varargin={'p','s',10,'name','john doe'};
validParameters={{'size','s'},{'print','p'},'name'};
parameters=validateInput(varargin,validParameters)
parameters =
print: 1
size: 10
name: 'john doe'

varargin={'p'}
validParameters={{'size','s'},{'print','p'},'name'}
parameters=validateInput(varargin,validParameters,true)

parameters =
print: 1
size: 0
name: 0

引用格式

Jed F. (2026). validateInput (https://ww2.mathworks.cn/matlabcentral/fileexchange/27338-validateinput), MATLAB Central File Exchange. 检索时间: .

致谢

启发作品: saveppt2

类别

Help CenterMATLAB Answers 中查找有关 Polygonal Shapes 的更多信息

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
1.0.0.0