PLOT THE GRAPH OF VECTOR FUNCTIONS

6 次查看(过去 30 天)
HOW TO graph the vector functions what is the matlab code to graph the vectoer functions

回答(2 个)

Bjorn Gustavsson
Bjorn Gustavsson 2019-9-18
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:
load wind
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

Steven Lord
Steven Lord 2019-9-18
If you have a picture in your mind of how you want the graph to look, open the Plots tab in the Toolstrip and click the triangle to the right side of the Plots section. Scroll through the thumbnails until you see one that looks close to what you want. The name of the function associated with that thumbnail is written below the thumbnail. You can open the documentation for that function to learn more about how to use it.
If you have variables selected in the Workspace component in the MATLAB Desktop when you open the Plots tab, you can limit what's shown to just those plots that can be created with the selected variables (based on the size and shape, I believe.) In that case you can click on the thumbnail to have MATLAB automatically create that plot for the selected data.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by