当前位置:网站首页>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);

边栏推荐
- Teach yourself to train pytorch model to Caffe (I)
- Alibaba cloud award winning experience: build a highly available system with polardb-x
- Simple interest mode - lazy type
- Clickhouse copy paste multi line SQL statement error
- 让开发效率飞速提升的跨端方案
- 2.2.5 basic sentences of R language drawing
- Wood board ISO 5660-1 heat release rate mapping test
- Some common processing problems of structural equation model Amos software
- Test of incombustibility of cement adhesives BS 476-4
- Selenium's method of getting attribute values in DOM
猜你喜欢

How to prepare for the algorithm interview and answer the algorithm interview questions

Golang (1) | from environmental preparation to quick start

Making global exception handling classes with aspect

Pytoch practice -- MNIST dataset handwritten digit recognition

Realize the function of verifying whether the user has completed login when browsing the page

Xlrd common operations

2022-07-03-CKA-粉丝反馈最新情况

校招期间 准备面试算法岗位 该怎么做?

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

How to send samples when applying for BS 476-7 display? Is it the same as the display??
随机推荐
办公遇到的问题--
Selenium's method of getting attribute values in DOM
Clickhouse copy paste multi line SQL statement error
postgis 安装地理信息扩展
Clion configures Visual Studio (MSVC) and JOM multi-core compilation
SQL knowledge leak detection
PVC plastic sheets BS 476-6 determination of flame propagation properties
Explain various hot issues of Technology (SLB, redis, mysql, Kafka, Clickhouse) in detail from the architecture
@Validated基础参数校验、分组参数验证和嵌套参数验证
让开发效率飞速提升的跨端方案
Alibaba cloud award winning experience: build a highly available system with polardb-x
How to send samples when applying for BS 476-7 display? Is it the same as the display??
Introduction to TS, constructor and its this, inheritance, abstract class and interface
场景化面试:关于分布式锁的十问十答
Longest swing sequence [greedy practice]
one hundred and twenty-three thousand four hundred and fifty-six
張麗俊:穿透不確定性要靠四個“不變”
Dictionary tree simple introductory question (actually blue question?)
ESP32
SQL common syntax records