关键是你这些代码放在哪里。比如:
function edit3_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global w1;
global w2;
global w;
w = abs(w2-w1);
u = (300000000*w)/(2*w1);
set(hObject,'string',num2str(u));
get(handles.eodit1,'String');试试string首字母大写