Question: %------------------------------------------------------ % For the Matlab code below, study the code, then do the following % . (3)Change the code so that it plots the vector

%------------------------------------------------------ % For the Matlab code below, study the code, then do the following % . (3)Change the code so that it plots the vector field with contours (at % 5 values only) of a linear ODE system, arrows' heads on, axis tight, legend, % arrows are red-color and contours should be black if over xy-plane and % blue if under xy-plane, title, captions,.... %===================================== function myquiver xmin = 0; xmax = 25; ymin = 0; ymax = 0.5;

R=2.3; C=1.2; V=@(t) 3*sqw(t,1,10); F=@(t,VC) (V(t)-VC)/(R*C); [T,VC]=meshgrid(linspace(xmin,xmax,10),linspace(ymin,ymax,10)); S=(3*sqw(T,1,10)-VC)/(R*C); L=sqrt(1+S.^2);

x_span = xmax - xmin; y_span = ymax - ymin; % Compute the scale factor so that vectors are 10% of plot window d = 0.1; X_world = 1./L; Y_world = S./L; s = d ./ sqrt((X_world / x_span).^2 + (Y_world / y_span).^2); quiver(T,VC,s.*X_world,s.*Y_world,'r','ShowArrowhead','off','AutoScale','off') axis([xmin,xmax,ymin,ymax])

% force the axis to be square axis('square');

function y=sqw(t,T,d) r=mod(t,T); y=(r

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!