Plotting data in 3D

조회 수: 1 (최근 30일)
Kanica Sachdev
Kanica Sachdev 2023년 5월 23일
댓글: Kanica Sachdev 2023년 5월 25일
I have a matrix that contains magnetic data in 3 axis (x,y,z) along with time (4th column). I need to plot this in a 3D graph, not points but lines of diffeernt color or some kind of mesh/net structure. How can i do that?
  댓글 수: 2
KSSV
KSSV 2023년 5월 23일
Attach your data.
Kanica Sachdev
Kanica Sachdev 2023년 5월 24일
@KSSV I have attached the data.

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

답변 (1개)

KSSV
KSSV 2023년 5월 24일
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1392204/plotdata.xlsx') ;
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
plot3(T.(3),T.(4),T.(5),'r')
  댓글 수: 7
KSSV
KSSV 2023년 5월 25일
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1392204/plotdata.xlsx') ;
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
x = T.(3) ;
y = T.(4) ;
z = T.(5) ;
dx = gradient(x) ;
dy = gradient(y) ;
dz = gradient(z) ;
quiver3(x,y,z,dx,dy,dz)
Kanica Sachdev
Kanica Sachdev 2023년 5월 25일
In the above plot, the time data is missing. Can we represent it all in one plot?

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

카테고리

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