![]() |
[求助]请教一个很初级的关于GUI中数据转换的问题
我想写一个做简单计算的界面,只有一个按钮和两个edit框。我的想法很简单,在edit1里输入一个数据,点击按钮,在edit2里显示输入数据的两次方。
我在按钮的程序里写 a=get(handles.edit1,'string'); c=str2num(a); b=c^2; set(handles.edit2,'string',b); 但运行之后显示 ??? Error using ==> str2num Requires string or character array input. Error in ==> untitled7>pushbutton1_Callback at 84 b=str2num(a); Error in ==> gui_mainfcn at 75 feval(varargin{:}); Error in ==> untitled7 at 44 gui_mainfcn(gui_State, varargin{:}); ??? Error while evaluating uicontrol Callback. 还望哪位壮士帮我改一下程序 提前先谢一下! |
所有时间均为北京时间。现在的时间是 11:16。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.