ch11_b.m

来自「线性调频信号通过匹配滤波器的程序 还有一些simulink仿真模型」· M 代码 · 共 29 行

M
29
字号
% Produce a state portrait for the SIMULINK model sysmdl_e% using a quiver ploth = 0.01 ; % Fixed step sizeopts = simset('Solver','ode5','FixedStep',h) ;x1 = -2.5:0.25:2.5 ;   % Set up the x1 and x2 gridx2 = -2.5:0.25:2.5 ;[nr,nc] = size(x1) ;  x1m = zeros(nc,nc) ;  % Allocate space for the output vectorsx2m = x1m ;for nx1 = 1:nc  for nx2 = 1:nc    opts = simset(opts,'InitialState',[x1(nx1),x2(nx2)]) ;    [t,x,y] = sim('sysmdl_e',h,opts) ;    dx1 = x(2,1)-x1(nx1) ;    dx2 = x(2,2)-x2(nx2) ;    l = sqrt(dx1^2 + dx2^2)*7.5 ;  % Scale the arrows    if l > 1.e-10      x1m(nx2,nx1)=dx1/l ;         % Notice the reversed indexes      x2m(nx2,nx1)=dx2/l ;    end  endendquiver(x1,x2,x1m,x2m,0) ;axis([-2.5,2.5,-2.5,2.5]) ;xlabel('x1') ;ylabel('x2') ;grid ;

⌨️ 快捷键说明

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