필터 지우기
필터 지우기

error in my code

조회 수: 1 (최근 30일)
thelong le
thelong le 2021년 6월 11일
댓글: KSSV 2021년 6월 11일
my code is having problem, when running the program it ends up as a line of colored points ?, why is it not distributed in space? how to be able to look at its spatial structure, someone explain to me, many thanks!
my code
X=get(handles.sr,'string');
Y=get(handles.sr,'string');
Z=get(handles.sr,'string');
% nhap gia tri XYZ
rgb = [ str2num(X) str2num(Y) str2num(Z) ];
xyz = rgb2xyz(rgb);
ylabel('Z');
zlabel('Y');
xlabel('X');
hold on;
% vẽ điểm ảnh
scatter3(xyz(:,1),xyz(:,3),xyz(:,2),1000,rgb,'.');
view(3); grid on;
axis image
axis([0 1 0 1.1 0 1]);
set(gca,'color','w','gridcolor','w','gridalpha',0.9);
set(gca,'projection','perspective');
and the result when i change the value of X,Y,Z
  댓글 수: 1
KSSV
KSSV 2021년 6월 11일
It is because your points are aligned in a line. The plot shows up what you give.

댓글을 달려면 로그인하십시오.

답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by