How to Plot the 3D points by Plot3 function in matlab?

조회 수: 39 (최근 30일)
Mahdi Noroozi
Mahdi Noroozi 2019년 6월 25일
답변: Himanshu Rai 2019년 6월 25일
This is a 3*6 matrix in which each column represents a three-dimensional point; I want to plot a three-dimensional plot using the Plot3 .
Thank you for answering
168.651320098755 168.656152628437 168.660985435090 168.665818518737 168.670651879402 168.675485517108
129.084161247190 129.022971519175 128.96177828414 128.900581541801 128.839381291840 128.778177533960
-13.7371238683462 -13.7375175202245 -13.7379111946644 -13.7383048916679 -13.7386986112370 -13.7390923533735
  댓글 수: 1
Monika Phadnis
Monika Phadnis 2019년 6월 25일
Let matrix be A
A = [168.651320098755 168.656152628437 168.660985435090 168.665818518737 168.670651879402 168.675485517108;
129.084161247190 129.022971519175 128.96177828414 128.900581541801 128.839381291840 128.778177533960;
-13.7371238683462 -13.7375175202245 -13.7379111946644 -13.7383048916679 -13.7386986112370 -13.7390923533735];
plot3(A(1,:),A(2,:),A(3,:))
So you send each row of matrix as X,Y and Z coordinate vectors.
Is this the desired result or you want something else?

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

채택된 답변

Himanshu Rai
Himanshu Rai 2019년 6월 25일
Use the following expression, assuming your matrix is stored in variable 'x'
plot3(x(1, :), x(2, :), x(3, :))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by