Using MATLAB/OCTAVE, plot the vector field ?⃗=?2?̂−??̂ ?? ?ℎ? ??????−2<?<+2 ???−2<?<+2
Find the magnitude of the vector field at the point (?0,?0)=(3,2).
write the type of code used
plots produced by this code
derivation or calculation required to write this code
The vector field can be plotted using the quiver comment and the magnitude of the vector field is calculated at the last section of the command. code is explained in each line
code:
% initializing x values
clc; clear all;
x=linspace(-2,2,10);
% initializing y values
y=linspace(-2,2,10);
% creating mesh grid
[X,Y]=meshgrid(x,y);
% assigning components
u=Y.*Y; v=-X;
% ploting vector lines using quiver command
quiver(x,y,u,v)
xlabel('x')
ylabel('y')
% to find the value of magnitude vector fied at 3,2
x0=3;
y0=2;
A=sqrt((y0^(4))+(x0^(2)))
Output:
plot:
as the vector equation is given,
the magnitude will be
Get Answers For Free
Most questions answered within 1 hours.