如何在Matlab中绘制连续的彩色矢量场? [英] How to plot continuous colored vector field in Matlab?
本文介绍了如何在Matlab中绘制连续的彩色矢量场?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有2个矩阵 A
和 B
,并且通过 quiver(A,B)
我可以轻松地绘制矢量场.但是,有人知道如何在Matlab中以下列方式可视化矢量场吗(真的不知道这种绘图的名称)
I have 2 matrices A
and B
, and by quiver(A,B)
I can easily plot a vector field. However, does anyone know how to visual vector field in the following way in Matlab?(don't really know the name of this kind of plot)
感谢您的帮助!
推荐答案
如果您正在寻找震级图(速度),则:
If you are looking for a map of magnitude (velocities), then:
v = sqrt( A.^2 + B.^2 );
figure; imagesc( v ); colormap jet;colorbar; axis image;
或者,如果您想要像这样的示例那样在HSV颜色空间中编码幅度和方向的结果:
Alternatively, if you want results that encode magnitude and direction in HSV color space like this example:
您可以找到此代码有用.
这篇关于如何在Matlab中绘制连续的彩色矢量场?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文