my code is not working

1 回表示 (過去 30 日間)
thelong le
thelong le 2021 年 6 月 10 日
回答済み: KSSV 2021 年 6 月 10 日
my program to convert from RGB to XYZ and draw those pixels on my 3D space is not working, when I run it, no pixels appear at all, can you give me the direction of the resolution?, thanks!
my code
% generate two clusters of color points
rgb = min(abs(randn(1,3).*[68 200 200] + [0 0 0]),1);
rgb = [rgb; 1-rgb];
xyz = rgb2xyz(rgb);
xlabel('X');
ylabel('Z');
zlabel('Y');
hold on;
% plot the points
scatter3(xyz(:,1),xyz(:,3),xyz(:,2),100,rgb,'.');
view(3); grid on;
axis equal
axis([0 255 0 255 0 255]);
set(gca,'color','w','gridcolor','w','gridalpha',0.3)
set(gca,'projection','perspective');

回答 (1 件)

KSSV
KSSV 2021 年 6 月 10 日
Increase the marker size and see.
scatter3(xyz(:,1),xyz(:,3),xyz(:,2),10000,rgb,'.');

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by