当前位置:网站首页>matlab绘制hsv色轮图
matlab绘制hsv色轮图
2022-07-05 21:35:00 【slandarer】
% 生成网格
tList=linspace(0,2.*pi,300);
rList=linspace(0,1,100);
[theta,R]=meshgrid(tList,rList);
% 角度及半径转换为坐标
X=cos(theta+pi).*R;
Y=sin(theta).*R;
Z=zeros(size(X));
% 构造hvs表(nx3)并转换为rgb表
thetaV=theta(:);RV=R(:);
hsvList=[thetaV./2./pi,ones(size(RV)),RV];
rgbList=hsv2rgb(hsvList);
% 将其变成矩阵三元组
C=zeros([size(X),3]);
C(:,:,1)=reshape(rgbList(:,1),size(X));
C(:,:,2)=reshape(rgbList(:,2),size(X));
C(:,:,3)=reshape(rgbList(:,3),size(X));
% surf绘图
surf(X,Y,Z,'EdgeColor','none','CData',C)
axis([-1,1,-1,1]);axis equal
view(0,90);

边栏推荐
- Interviewer: will concurrent programming practice meet? (detailed explanation of thread control operation)
- Influence of oscilloscope probe on measurement bandwidth
- Dictionary tree simple introductory question (actually blue question?)
- Teach yourself to train pytorch model to Caffe (2)
- js常用方法封装
- Using webassembly to operate excel on the browser side
- Li Kou ----- the maximum profit of operating Ferris wheel
- 办公遇到的问题--
- GCC9.5离线安装
- Three components of openpyxl
猜你喜欢

Evolution of zhenai microservice underlying framework from open source component encapsulation to self-development

EasyExcel的读写操作

Pytoch practice -- MNIST dataset handwritten digit recognition

Cold violence -- another perspective of objective function setting

使用Aspect制作全局异常处理类

Why can't Chinese software companies produce products? Abandon the Internet after 00; Open source high-performance API gateway component of station B | weekly email exclusive to VIP members of Menon w

張麗俊:穿透不確定性要靠四個“不變”

uni-app 蓝牙通信

Teach yourself to train pytorch model to Caffe (2)

【案例】定位的运用-淘宝轮播图
随机推荐
Traps in the explode function in PHP
Influence of oscilloscope probe on signal source impedance
2022-07-03-CKA-粉丝反馈最新情况
Xlrd common operations
Golang(1)|从环境准备到快速上手
Chap2 steps into the palace of R language
2.2 basic grammar of R language
Display DIN 4102-1 Class B1 fire test requirements
How to send samples when applying for BS 476-7 display? Is it the same as the display??
1.2 download and installation of the help software rstudio
Cold violence -- another perspective of objective function setting
Some common processing problems of structural equation model Amos software
让开发效率飞速提升的跨端方案
DBeaver同时执行多条insert into报错处理
[case] Application of positioning - Taobao rotation map
[daily training] 729 My schedule I
2.2.5 basic sentences of R language drawing
int GetMonth( ) const throw( ); What does throw () mean?
XML modeling
What are the requirements of UL 2043 test for drive housing in the United States?