# PLOT THE GRAPH OF VECTOR FUNCTIONS

33 views (last 30 days)
ASHOK VARDHAN on 18 Sep 2019
Answered: Steven Lord on 18 Sep 2019
HOW TO graph the vector functions what is the matlab code to graph the vectoer functions

Bjorn Gustavsson on 18 Sep 2019
So you want to plot a vector-function , where f gives you 3-element vectors at points in 3-D space. For that you might get what you need from quiver3.
But in my experience (for what that's worth) such plots rarely gives me as good an illustration of what's going on as
I hope. You might get additional/alternative plots with streamline. Then there are the functions for simpler cases such as compass, feather, rose, and I've liklely forgotten. Also have a look at the file exchange.
Then you could go creative, something like (for case with r in 2-D), you could put the x, y, and z components of your arrays v into the r, g, and b, components of an image and display that as and image:
U = u(:,:,12);
V = v(:,:,12);
W = w(:,:,12);
RGB(:,:,3) = (W-min(W(:)))/(max(W(:))-min(W(:)));
RGB(:,:,2) = (V-min(V(:)))/(max(V(:))-min(V(:)));
RGB(:,:,1) = (U-min(U(:)))/(max(U(:))-min(U(:)));
imagesc(RGB)
Which gives a result I'd never use, but you might do other combinations, starting with mapping magnitude and directions to HSV/HSI/CLAB spaces - something might stick.
HTH