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://jp.mathworks.com/matlabcentral/fileexchange/27338-validateinput), MATLAB Central File Exchange. に取得済み.

謝辞

ヒントを与えたファイル: saveppt2

カテゴリ

Help Center および MATLAB AnswersElementary Polygons についてさらに検索

一般的な情報

MATLAB リリースの互換性

  • すべてのリリースと互換性あり

プラットフォームの互換性

  • Windows
  • macOS
  • Linux
バージョン 公開済み リリース ノート Action
1.0.0.0