Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MATLAB编辑文本:显示超过8个字符_Matlab_Textbox - Fatal编程技术网

MATLAB编辑文本:显示超过8个字符

MATLAB编辑文本:显示超过8个字符,matlab,textbox,Matlab,Textbox,我试图在MatlabGUI的编辑文本中显示这个数字“16777215”,但最终得到了这个数字“1.67772e+07” 这是用于在文本框中显示数字的代码: set(handles.edit7, 'string', max_count); 我怎样才能解决这个问题 谢谢我想你可以起诉sprintf function。例如: mFigure = figure() mTextBox = uicontrol('style','text', 'Position', [20 240 200 20]) s

我试图在MatlabGUI的编辑文本中显示这个数字“16777215”,但最终得到了这个数字“1.67772e+07”

这是用于在文本框中显示数字的代码:

set(handles.edit7, 'string', max_count);
我怎样才能解决这个问题


谢谢

我想你可以起诉sprintf function。例如:

mFigure = figure()
mTextBox = uicontrol('style','text',  'Position', [20 240 200 20])

set(mTextBox,'String', sprintf('%d', 16777215))

我能够观察到你提到的同样的行为。当我在将数字转换为字符串的函数中包装
max\u count
时,
num2str
,16777215如预期出现:

set(handles.edit7, 'string', num2str(max_count));