Plotting data in 3D

1 Ansicht (letzte 30 Tage)
Kanica Sachdev
Kanica Sachdev am 23 Mai 2023
Kommentiert: Kanica Sachdev am 25 Mai 2023
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 Kommentare
KSSV
KSSV am 23 Mai 2023
Attach your data.
Kanica Sachdev
Kanica Sachdev am 24 Mai 2023
@KSSV I have attached the data.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KSSV
KSSV am 24 Mai 2023
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 Kommentare
KSSV
KSSV am 25 Mai 2023
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 am 25 Mai 2023
In the above plot, the time data is missing. Can we represent it all in one plot?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by