MATLAB Answers

how to draw 4 D line plot (not a scatter plot) on MATLAB, with two such curves on same 4 D space

1 view (last 30 days)
SNT
SNT on 22 Jul 2019
Commented: Gaurav Garg on 2 Aug 2019
Hello everyone,
I am looking at making a 4 D line plot. I found a link on how to make a scatter plot here https://www.mathworks.com/help/matlab/visualize/visualizing-four-dimensional-data.html#Visualizing4DExample-5. But i am unable to get a line plot for the same.
My data is as below; A and B are two arrays with "x,y,z,time" in the four respective columns 1,2,3,4.
A = [
34.02 146.88 125.452 0.40036
33.804 142.992 125.452 0.80072
33.588 140.94 125.468 1.20108
32.94 137.7 125.463 1.60144
33.372 135.54 125.398 2.0018
34.344 132.3 125.38 2.40216
35.316 129.384 125.348 2.80252
35.1 127.008 125.346 3.20288
35.208 124.524 125.346 3.60324
35.856 121.932 125.356 4.0036
]
B = [
33.81855901 143.1587554 125.402 0.80072
33.67937179 141.0413155 125.418 1.20108
33.04378294 137.7898625 125.513 1.60144
33.41107715 135.658574 125.398 2.0018
34.36013364 132.3528975 125.48 2.40216
35.43396598 129.4757853 125.398 2.80252
35.11838456 127.152052 125.396 3.20288
35.33127133 124.6252584 125.396 3.60324
35.93352491 121.9982298 125.356 4.0036
]
What I would like to do is draw both A and B side by side in the same 4D plot (x,y,z). A and B must appear as a line plot and not a scatter plot. Also the "time" column must appear as a colour coded 4th dimension in both A and B in same plot.
It would be wonderful if someone could give me few pointers for this.
Thanks a lot in advance!
S

  1 Comment

Gaurav Garg
Gaurav Garg on 2 Aug 2019
Hi,
It isn't very clear on how should "time" column appear as a colour coded 4th dimension after you have already plotted (x,y,z).
Do you mean it is the 4th dimension for the plot?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!