⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 q.asv

📁 都是一些matlab图形用户界面的设计实例
💻 ASV
📖 第 1 页 / 共 2 页
字号:
function edit7_Callback(hObject, eventdata, handles)% hObject    handle to edit7 (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 edit7 as text%        str2double(get(hObject,'String')) returns contents of edit7 as a double% --- Executes during object creation, after setting all properties.function edit8_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit8 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit8_Callback(hObject, eventdata, handles)% hObject    handle to edit8 (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 edit8 as text%        str2double(get(hObject,'String')) returns contents of edit8 as a double% --- Executes during object creation, after setting all properties.function edit9_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit9 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit9_Callback(hObject, eventdata, handles)% hObject    handle to edit9 (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 edit9 as text%        str2double(get(hObject,'String')) returns contents of edit9 as a double% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton3 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global Z
global P
global K
str=get(handles.edit5,'string')
num1=eval(str);
str=get(handles.edit6,'string')
den1=eval(str);
[Z,P,K]=tf2zp(num1,den1)
z=num2str(Z);
p=num2str(P);
k=num2str(K);
set(handles.text44,'string',z)
set(handles.text43,'string',p)
set(handles.text45,'string',k)% --- Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton4 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global num1
global den1
str=get(handles.edit7,'string')
z=eval(str);
str=get(handles.edit8,'string')
p=eval(str);
str=get(handles.edit9,'string')
k=eval(str);
[num1,den1]=zp2tf(z,p,k);
num2=num2str(num1);
den2=num2str(den1);

set(handles.text46,'string',num2)
set(handles.text47,'string',den2)
% --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton5 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
str=get(handles.edit7,'string')
z=eval(str);
str=get(handles.edit8,'string')
p=eval(str);
str=get(handles.edit9,'string')
k=eval(str);
[A,B,C,D]=zp2ss(z,p,k);
a=num2str(A);
b=num2str(B);
c=num2str(C);
d=num2str(D);
set(handles.text29,'string',a)
set(handles.text20,'string',b)
set(handles.text19,'string',c)
set(handles.text21,'string',d)% --- Executes on button press in pushbutton6.function pushbutton6_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton6 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global Z
global P
global K
str=get(handles.edit1,'string')
a=eval(str);
str=get(handles.edit2,'string')
b=eval(str);
str=get(handles.edit3,'string')
c=eval(str);
str=get(handles.edit4,'string')
d=eval(str);
[Z,P,K]=ss2zp(a,b,c,d);
z2=num2str(Z);
p2=num2str(P);
k2=num2str(K);
set(handles.text44,'string',z2)
set(handles.text43,'string',p2)
set(handles.text45,'string',k2)% --- Executes on button press in pushbutton7.function pushbutton7_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton7 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
str=get(handles.edit5,'string')
num1=eval(str);
str=get(handles.edit6,'string')
den1=eval(str);
[A,B,C,D]=tf2ss(num1,den1);
a=num2str(A);
b=num2str(B);
c=num2str(C);
d=num2str(D);
set(handles.text29,'string',a)
set(handles.text20,'string',b)
set(handles.text19,'string',c)
set(handles.text21,'string',d)

% --- Executes on button press in pushbutton8.function pushbutton8_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton8 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global num1,
global den1,

str=get(handles.edit1,'string')
A=eval(str);
str=get(handles.edit2,'string')
B=eval(str);
str=get(handles.edit3,'string')
C=eval(str);
str=get(handles.edit4,'string')
D=eval(str);
[num1,den1]=ss2tf(A,B,C,D,1);
a=num2str(num1);
b=num2str(den1);
set(handles.text46,'string',a)
set(handles.text47,'string',b)% --- Executes on button press in pushbutton9.function pushbutton9_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton9 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function Untitled_1_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
global num1,
global den1,
global Z,
global P,
global K,
filename=input()
%filename1=inputdlg('Please input filename')
save filename1 num1 den1 A B C D Z P K% --------------------------------------------------------------------function Untitled_2_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
global num1,
global den1,
global Z,
global P,
global K,
filename1=inputdlg('Please input filename')
load filename1 
num2=num2str(num1)
set(handles.text46,'string',num2)den2=num2str(den1)
set(handles.text47,'string',den2)
A1=num2str(A)
set(handles.text29,'string',A1)
B1=num2str(B)
set(handles.text20,'string',B1)
C1=num2str(C)
set(handles.text19,'string',C1)
D1=num2str(D)
set(handles.text21,'string',D1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -