validateInput

Versione 1.0.0.0 (2,5 KB) da Jed F.
A simple 'getOpts' type script to validate input parameters.
700 download
Aggiornato 22 apr 2010

Visualizza la licenza

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

Cita come

Jed F. (2026). validateInput (https://it.mathworks.com/matlabcentral/fileexchange/27338-validateinput), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2007b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Elementary Polygons in Help Center e MATLAB Answers
Riconoscimenti

Ispirato: saveppt2

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0