?? guical.m
字號:
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function result_Callback(hObject, eventdata, handles)
% hObject handle to result (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of result as text
% str2double(get(hObject,'String')) returns contents of result as a double
% --- Executes during object creation, after setting all properties.
function result_CreateFcn(hObject, eventdata, handles)
% hObject handle to result (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in log10.
function log10_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
v3=log10(v2);
v4=num2str(v3);
set(handles.result,'string',v4);
v5=strcat('log10','(',v1,')','=',v4);
set(handles.progress,'string',v5);
% hObject handle to log10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton32.
function pushbutton32_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton32 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in cos.
function cos_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
% v3=v2*pi/180;
v4=cos(v2);
v5=num2str(v4);
set(handles.result,'string',v5);
v6=strcat('cos','(',v1,')','=',v5);
set(handles.progress,'string',v6);
% hObject handle to cos (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton34.
function pushbutton34_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton34 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton35.
function pushbutton35_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton35 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton36.
function pushbutton36_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton36 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in ln.
function ln_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
v3=log(v2);
v4=num2str(v3);
set(handles.result,'string',v4);
v5=strcat('log','(',v1,')','=',v4);
set(handles.progress,'string',v5);
% hObject handle to ln (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton39.
function pushbutton39_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton39 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit4 as text
% str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function progress_Callback(hObject, eventdata, handles)
% hObject handle to progress (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of progress as text
% str2double(get(hObject,'String')) returns contents of progress as a double
% --- Executes during object creation, after setting all properties.
function progress_CreateFcn(hObject, eventdata, handles)
% hObject handle to progress (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on key press over clock with no controls selected.
function clock_KeyPressFcn(hObject, eventdata, handles)
k=1;
while k==1;
a=datestr(now);
set(gcbo,'string',a);
pause(1);
end
% hObject handle to clock (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in updown.
function updown_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v=(eval(v1));
v=1/v;
set(handles.result,'string',v);
v=num2str(v);
vp=strcat('1','/',v1,'=',v);
set(handles.progress,'string',vp);
% hObject handle to updown (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in sin.
function sin_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
%
v4=sin(v2);
v5=num2str(v4);
set(handles.result,'string',v5);
v6=strcat('sin','(',v1,')','=',v5);
set(handles.progress,'string',v6);
% hObject handle to sin (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in tan.
function tan_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
% v3=v2*pi/180;
v4=tan(v2);
v5=num2str(v4);
set(handles.result,'string',v5);
v6=strcat('tan','(',v1,')','=',v5);
set(handles.progress,'string',v6);
% hObject handle to tan (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in cot.
function cot_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
% v3=v2*pi/180;
v4=cot(v2);
v5=num2str(v4);
set(handles.result,'string',v5);
v6=strcat('cot','(',v1,')','=',v5);
set(handles.progress,'string',v6);
% hObject handle to cot (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in sec.
function sec_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
% v3=v2*pi/180;
v4=sec(v2);
v5=num2str(v4);
set(handles.result,'string',v5);
v6=strcat('sec','(',v1,')','=',v5);
set(handles.progress,'string',v6);
% hObject handle to sec (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in csc.
function csc_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
% v3=v2*pi/180;
v4=csc(v2);
v5=num2str(v4);
set(handles.result,'string',v5);
v6=strcat('csc','(',v1,')','=',v5);
set(handles.progress,'string',v6);
% hObject handle to csc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in power2.
function power2_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
v3=v2^2;
v4=num2str(v3);
set(handles.result,'string',v4);
v5=strcat('(',v1,')','^','2','=',v4);
set(handles.progress,'string',v5);
% hObject handle to power2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in power3.
function power3_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
v3=v2^3;
v4=num2str(v3);
set(handles.result,'string',v4);
v5=strcat('(',v1,')','^','3','=',v4);
set(handles.progress,'string',v5);
% hObject handle to power3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton41.
function pushbutton41_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton41 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton42.
function pushbutton42_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton42 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in rightbracket.
function rightbracket_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=strcat(v1,'(');
set(handles.result,'string',v2);
% hObject handle to rightbracket (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in log2.
function log2_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
v3=log2(v2);
v4=num2str(v3);
set(handles.result,'string',v4);
v5=strcat('log2','(',v1,')','=',v4);
set(handles.progress,'string',v5);
% hObject handle to log2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in exppower.
function exppower_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
v3=exp(v2);
v4=num2str(v3);
set(handles.result,'string',v4);
v5=strcat('exp','(',v1,')','=',v4);
set(handles.progress,'string',v5);
% hObject handle to exppower (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pai.
function pai_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=strcat(v1,'pi');
set(handles.result,'string',v2);
% hObject handle to pai (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in leftbracket.
function leftbracket_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=strcat(v1,')');
set(handles.result,'string',v2);
% hObject handle to leftbracket (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in factorial.
function factorial_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
v2=str2num(v1);
n=v2;
f=factor(n); %調用factor子函數,求n!
f1=num2str(f);
set(handles.result,'string',f1);
v3=strcat(v1,'!','=',f1);
set(handles.progress,'string',v3);
% hObject handle to factorial (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -