The question i am asked is:
Generate a 21 X 21 mesh on a xy coordinate system. Mesh x & y are bounded in a square -1≤x≤1 & -1≤y≤1. At each grid point, u(x,y)=1/x, v(x,y)=1/y. Plot (u,v) vector at each grid (x,y) in the given region. [Hint: dx=dy=0.1 ]
My code is:
clc;dx=0.1;[x,y] = meshgrid(-1:dx:1, -1:dx:1); % creating meshgrid
u=1./x;v=1./y;quiver(x,y,u,v);axis equal
Best Answer