?? foh.m
字號:
function foh(y,alpha,Ts)% plot the output of fractional-order hold% % input: y - discrete signal vector as input signal to a fractional % order hold% alpha - 0 <= alpha <= 1, hold characteristics% Ts = sampling period%%%%%%%%%%%%%%%%%%%%% foh.m %%%%%%%%%%%%%%%%%%%%%% Discrete-Time Control Problems using %% MATLAB and the Control System Toolbox %% by J.H. Chow, D.K. Frederick, & N.W. Chbat %% Brooks/Cole Publishing Company %% September 2002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%n = length(y);% first point - need special logic% it is always assumed that the -1 point is zero%figureplot([-1 0]*Ts,[0 0])hold on plot([0 0]*Ts,[0 y(1)])plot(0,y(1),'o')yfoh(2) = y(1)+y(1)*alpha;plot([0 1]*Ts,[y(1) yfoh(2)])disp('<< press space bar to continue >>'), pausefor ii = 2:n plot([ii-1 ii-1]*Ts,[yfoh(ii) y(ii)]) plot((ii-1)*Ts,y(ii),'o') yfoh(ii+1) = y(ii)+(y(ii)-y(ii-1))*alpha; plot([ii-1 ii]*Ts,[y(ii) yfoh(ii+1)]) disp('<< press space bar to continue >>'), pauseendtitle('Output of Fractional Order Hold')xlabel('Time (k*Ts)')ylabel('Amplitude')hold off %%%%%%%%%%
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -