Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to load values for a vector field?

Status
Not open for further replies.

josephp

Automotive
Joined
Sep 20, 2006
Messages
1
Location
US
The examples I see for vector fields go somewhat like this...

[x,y] = meshgrid(-10:1:10,-10:1:10);
M = x;
N = -y;
quiver(x,y,M,N)

I don't want to use a function to fill in the values, but want to load point by point.

For example, if I want to manually load the first element, in this case the element at (-10,-10) with the values (3.2,-1.9), how would I do it?
 
josephp,

The vector field is drawn by 'quiver(x,y,U,V)'

x and y are the coords to draw the vector and U and V are the values for the vector.

So to do what you stated above make 4 matrices that have the same dimensions one for each x,y,U,V.

and then pass them to quiver to get your vector field plot.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top