当前位置:网站首页>Matlab map with color representation module value size arrow
Matlab map with color representation module value size arrow
2022-08-05 02:18:00 【zdlwhereyougo】
The quiver function that comes with matlab can draw arrow graphs. The length of the arrow corresponds to the magnitude of the modulus value of the vector.If you want to achieve the same length of arrows, first normalize the arrows, calculate the magnitude of the modulus of all arrows, calculate the scaling factor of each arrow, and then scale the vertical and horizontal components so that the modulus of all arrows are equal.Then divide the modulus value into 256 values from large to small, and use the colormap matrix that comes with matlab to color the arrows in turn.
Look directly at the image: the left is the original image, the right is the adjusted image
Source code:
clc;close all;clear ;% construct dataload('wind','x','y','u','v')X = x(11:22,11:22,1);Y = y(11:22,11:22,1);U = u(11:22,11:22,1);V = v(11:22,11:22,1);%% default drawingfigurequiver(X,Y,U,V,'r')%% adjust drawingM=sqrt(U.^2+V.^2);% Calculated moduluscolorlist=jet;% load the color bar, you can also replace other, cool, winter, etc.Mdown=min(M(:));Mup=max(M(:));Mlist=linspace(Mdown,Mup,256);scaler1=Mup./M;% length adjustment factorU=U.*scaler1;% Adjust each componentV=V.*scaler1;% Adjust each componentscaler2=0.05;% rescale the length to fit the drawingU=U*scaler2;V=V*scaler2;figure[m,n]=size(X);for i=1:mfor j=1:nMtemp=abs(M(i,j)-Mlist);index=find(Mtemp==min(Mtemp));colorarrow=colorlist(index,:);q =quiver(X(i,j),Y(i,j),U(i,j),V(i,j),'MaxHeadSize',100);% Draw each one separately and adjust the size of the arrowq.LineWidth=1;q.Color=colorarrow;hold onendendhc=colorbar;colormap(jet)hc.TickLabels=linspace(Mdown,Mup,11);边栏推荐
- 程序员失眠时的数羊列表 | 每日趣闻
- CMS建站流程
- Live preview | 30 minutes started quickly!Look at credible distributed AI chain oar architectural design
- 树表的查找
- LPQ (local phase quantization) study notes
- .Net C# 控制台 使用 Win32 API 创建一个窗口
- 记录谷歌gn编译时碰到的一个错误“I could not find a “.gn“ file ...”
- Live playback including PPT download | Build Online Deep Learning based on Flink & DeepRec
- 短域名绕过及xss相关知识
- 2022 EdgeX中国挑战赛8月3日即将盛大开幕
猜你喜欢

source program in assembly language

记录谷歌gn编译时碰到的一个错误“I could not find a “.gn“ file ...”

HOG feature study notes

关于#sql shell#的问题,如何解决?

How do programmers without objects spend the Chinese Valentine's Day

《.NET物联网从零开始》系列

直播回放含 PPT 下载|基于 Flink & DeepRec 构建 Online Deep Learning

蚁剑高级模块开发

Xunrui cms website cannot be displayed normally after relocation and server change

基于OpenVINO工具套件简单实现YOLOv7预训练模型的部署
随机推荐
Amazon Cloud Technology joins hands with Thundersoft to build an AIoT platform for industry customers
金仓数据库 KingbaseES V8 GIS数据迁移方案(3. 基于ArcGIS平台的数据迁移到KES)
oracle将restful接口封装到视图中
【Unity入门计划】2D游戏中遮挡问题的处理方法&伪透视
Residential water problems
<开发>实用工具
高数_复习_第1章:函数、极限、连续
1349. Maximum number of students taking the exam Status Compression
Chapter 09 Use of Performance Analysis Tools [2. Index and Tuning] [MySQL Advanced]
关于#sql shell#的问题,如何解决?
PHP技能评测
“嘀哩哩,等灯等灯”,工厂安全生产的提示音
海量服务实例动态化管理
短域名绕过及xss相关知识
浅谈数据安全治理与隐私计算
Oracle encapsulates restful interfaces into views
【genius_platform软件平台开发】第七十六讲:vs预处理器定义的牛逼写法!!!!(其他组牛逼conding人员告知这么配置来取消宏定义)
2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
没有对象的程序员如何过七夕
fragment可见性判断