numeric UI Control

Versión 1.5.0.0 (11,1 KB) por Kyle
Make a custom ui control that is an editbox that only allows numeric inputs.
400 Descargas
Actualizado 28 feb 2012

Ver licencia

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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Citar como

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

Compatibilidad con la versión de MATLAB
Se creó con R2009a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Versión Publicado Notas de la versión
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