[CENTER]بسم الله الرحمن الرحيم
i designed on GUI 3 edit texts and 3 static texts the first edit text must recieve the input ‘triangle’ to let edit2(base) and edit3(height) appear by clicking on push button ‘ok’ and i’ve done this
Hint: i used uicontrol callback
but the problem is when i want to insert numbers in each edit text there is an error accured
??? Undefined function or method ‘edit2_callback’ for input arguments of type
’double’.
??? Error while evaluating uicontrol Callback
هذا الكود كتبتو في البوش بوتون الok[/center]
[SIZE=5]h1 = uicontrol(‘Style’,‘edit’,‘backgroundColor’,‘White’,‘String’,’’,‘Position’,[140,207,68,37],‘Callback’,{@edit2_callback});
h2 = uicontrol(‘Style’,‘edit’,‘backgroundColor’,‘White’,‘String’,’’,‘Position’,[352,206,68,37],‘Callback’,{@edit3_callback});
h3 = uicontrol(‘Style’,‘text’,‘ForegroundColor’,‘Blue’,‘String’,‘base’,‘Position’,[144,245,55,25],‘Callback’,{@stat1_callback});
h4 = uicontrol(‘Style’,‘text’,‘ForegroundColor’,‘Blue’,‘String’,‘height’,‘Position’,[360,245,55,25],‘Callback’,{@stat2_callback});
select=get(handles.edit1,‘String’);
if (select==‘triangle’)
set(h1,‘visible’,‘on’)
set(h2,‘visible’,‘on’)
set(h3,‘visible’,‘on’)
set(h4,‘visible’,‘on’)
end
[FONT=Courier New][SIZE=2]guidata(hObject,handles);
وهذا الكود كتبتو في بوش بوتون ال
calculation
عشان احسب قيمة الرقمين المدخلين
a = get(handles.edit2,‘String’);
b = get(handles.edit3,‘String’);
total = 0.5ab;
c = num2str(total);
% need to convert the answer back into String type to display it
set(handles.stat3,‘String’,c);
guidata(hObject,handles);
[/size][/font][/size][CENTER]بليييييييييز ساعدوني
[/center]