Question: For the ones that would like to try MATLAB: Let s use MATLAB to plot the vector field corresponding to the right - hand side

For the ones that would like to try MATLAB: Lets use MATLAB
to plot the vector field corresponding to the right-hand side of ODE
dy
dx =2x.(1)
Execute the following commands in the MATLAB command window:
1. Create a mesh in the (x, y)-plane:
[x,y]=meshgrid(-5:0.2:5);
2. For each point of the mesh, calculate x and y coordinates of vector tip:
dx=1;
dy=2*x;
3. Calculate the vector length:
r=(dx.^2+dy.^2).^0.5;
4. Divide coordinates with vector length to normalize the vector:
px=dx./r;
py=dy./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!