?? lab03.m
字號:
function lab03()
clear all;
clc;
col0=[0.7 0.7 0.7]; %灰色
col1=[1 1 1]; %白色
%創建當前窗口
mainwin=figure('Color',col0,'Pos',[70 60 700 500],...
'Name','180度根軌跡實驗窗口','NumberTitle','off',...
'MenuBar','none','Resize','off');
dd=text(0.25,0.9,'根軌跡實驗窗口');
set(dd,'fontsize',20,'color',[0,0,1],'fontname','宋體');
hold on;
%輸入前向通道參數按鈕
uicontrol('style','push','units','normal','pos',[0.4 0.5 0.15 0.15],'string','G(s)',...
'fontsize',15 ,'call','input_g');
%輸入反饋參數按鈕
uicontrol('style','push','units','normal','pos',[0.4 0.3 0.15 0.15],'string','H(s)',...
'fontsize',15,'call','input_h');
%畫一個比較器
uicontrol('style','radio','units','normal','pos',[0.2 0.55 0.03 0.04],'enable','off','back',col0)
%畫根軌跡圖
uicontrol('style','push','units','normal','pos',[0.25 0.1 0.2 0.1],...
'string','根軌跡圖','fontsize',15,'call','root');
%關閉按鈕
uicontrol('style','push','units','normal','pos',[0.6 0.1 0.15 0.1],'string','退出',...
'fontsize',15,'call',['clear all;clc;close;']);
%畫方框圖的信號線
x=[0 0.88 0.8 0.8 0.11 0.11];
y=[0.57 0.57 0.57 0.3 0.3 0.57];
plot(x,y,'k');
hold on;
%畫負反饋的'-'號
x=[0.05 0.08];y=[0.5 0.5];
plot(x,y,'k');
hold on;
%畫信號線上的箭頭
x=[0.06 0.09 0.06];
y=[0.59 0.57 0.55];
plot(x,y,'k');hold on;
x=[0.85 0.88 0.85];
y=[0.59 0.57 0.55];
plot(x,y,'k');hold on;
x=[0.095 0.11 0.125];
y=[0.5 0.55 0.5];
plot(x,y,'k');hold on;
dd=text(-0.1,0.65,'輸入R(t)');
set(dd,'fontsize',15,'color',[0,0,1],'fontname','宋體');
dd=text(0.8,0.65,'輸出C(t)');
set(dd,'fontsize',15,'color',[0,0,1],'fontname','宋體');
axis([0 1 0 1]);
axis off;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -