numeric UI Control

Version 1.5.0.0 (11,1 ko) par Kyle
Make a custom ui control that is an editbox that only allows numeric inputs.
400 téléchargements
Mise à jour 28 fév. 2012

Afficher la licence

Allow a uicontrol that is an edit box that only allows numeric inputs. There are different types of inputs (ie integers, non-negative, scalars). The top level command is numericEdit. There are also sub files that are helpful like customControl that can be used independently.

Requires matlab version that can utilize classdef.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% numericEdit
%
% h = numericEdit(numericType, AllowDecimal, AllowNegative, 'parameter,
% 'value', ...)
%
% Creates a uicontrol edit box that must be numeric.
% NOTE: fixing non numeric inputs relies on a timer object and is thus
% not incredibly reliable.
%
% Types of numeric are accessed by numericEdit. (various types)
% ONLY_NUMERIC_CHARACTERS:
% literally only characters "-", and 0-9. are allowed
% ONLY_NUMERIC_RESULT:
% the result will be checked after enter is finished and attempt to
% convert input into a numeric, ie pi will result in 3.14159 even
% though pi explicity is not 0-9.
% ONLY_LENGTH_ONE_NUMERIC_RESULT:
% Check the result and must be numeric with length=1
%
% AllowDecimal is a boolean to allow not integer data
% AllowNegative is a boolean to allow negative numbers
%
% Example
% numericEdit(numericEdit.ONLY_NUMERIC_CHARACTERS, true, true, 'width',10)
%
% See also customControl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Citation pour cette source

Kyle (2026). numeric UI Control (https://fr.mathworks.com/matlabcentral/fileexchange/35095-numeric-ui-control), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2009a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Version Publié le Notes de version
1.5.0.0

updated tags

1.4.0.0

updated tags

1.3.0.0

missing enum file included in zip

1.0.0.0