Visualise 3D trajectory data as a volume plot
조회 수: 6 (최근 30일)
이전 댓글 표시
I have 3D trajectory data (x, y, z coordinates) which I would like to visualise as a volume plot. I'm using plot3 but just getting a line plot - see attached pdf with images of what I'm getting using plot3 and what I would like to get.
I've also attached a .mat file containing my 3D-trajectory data.
Many thanks for your help.
댓글 수: 2
채택된 답변
KSSV
2018년 7월 26일
편집: KSSV
2018년 7월 27일
Check the below trial code:
S = matfile('C:\Users\srinivas\Downloads\3DTraj.mat') ;
x = S.xSmooth ;
y = S.ySmooth ;
z = S.zSmooth ;
x = x(1:5:end) ; y = y(1:5:end) ; z = z(1:5:end) ;
N = [diff(x) diff(y) diff(z)] ;
C = 20*ones(size(x)) ;
figure
hold on
plot3(x,y,z,'r')
Cx = zeros([],[]) ;
Cy = zeros([],[]) ;
Cz = zeros([],[]) ;
for i = 1:1:length(x)-1
center = [x(i) y(i) z(i)] ;
normal = [N(i,1) N(i,2) N(i,3)] ;
radius = C(i) ;
P = plotCircle3D(center,normal,radius) ;
Cx(i,:) = P(1,:);
Cy(i,:) = P(2,:);
Cz(i,:) = P(3,:);
end
h = mesh(Cx,Cy,Cz) ; shading interp
h.FaceAlpha = 0.5 ;
Download the functions from the link:
댓글 수: 5
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!