📄 ch11_f.m
字号:
% Produce a state portrait for the SIMULINK model sysmdl_l% using a quiver ploth = 0.01 ; % Fixed step sizeopts = simset('Solver','ode5','FixedStep',h) ;x1 = -3:0.25:3 ; % Set up the x1 and x2 gridx2 = -3:0.25:3 ;[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_l',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([-3,3,-3,3]) ;xlabel('x1') ;ylabel('x2') ;grid ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -