Numeric Editbox

版本 1.1.0.1 (16.7 KB) 作者: Sean de Wolski
This class provides a numeric editbox uicontrol.
609.0 次下载
更新时间 2016/9/1

查看许可证

The typical MATLAB uicontrol edit box allows for any string to be input
by the user. Often times, we want numeric values only and have to safe
guard against this in the edit box callback:

function editbox_callback(src,evt)
if isnan(str2double(src.Value))
warning('Not a string')
src.Value = 1
end

This class saves the effort of checking this and provides a few
additional features as well.

In addition to the standard uicontrol properties used by an edit box, there are
four additional ones:

* Value: The numeric value of the edit box.
* RoundFractionalValues: If true, the numericEditbox only accepts integers.
* Limits: Minimum and Maximum acceptable values.
* ValueChangedFcn: Callback that fires when a valid new value is accepted.
There is also a 'ValueChanged' event that can be listened for when an
acceptable input changes the 'Value'.

引用格式

Sean de Wolski (2025). Numeric Editbox (https://www.mathworks.com/matlabcentral/fileexchange/48767-numeric-editbox), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2014b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Migrate GUIDE Apps 的更多信息
标签 添加标签

Community Treasure Hunt

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

Start Hunting!

html/

版本 已发布 发行说明
1.1.0.1

Updated license

1.1.0.0

Correct Version

1.0.0.0