0
$\begingroup$

I am using again Mathematica and enjoying it.

I have a question, is there a way to do a "time" plot of 3D vectors?

I try to be more clear, I have 12 vectors (3D vectors). They are changing over time during a MATLAB simulation (in particular they are changing their direction).

I would like to have a "video" of how they move over time.

Of course I will give to mathematica:

  • 3D matrix of the vectors: 12x3x755 (where 755 is the number of samples)
  • Time vector : 755x1

Could you please help me or point me in the right direction?

Thanks a lot, Fab.

EDIT: I didn't find a way to attach a file and I don't know if there is one.

Here it is a sample of my vectors:

val(:,:,1) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,2) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6541    0.7565   -0.0001


val(:,:,3) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6541    0.7565   -0.0001


val(:,:,4) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6541    0.7565   -0.0001


val(:,:,5) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6541    0.7565   -0.0001


val(:,:,6) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6541    0.7565   -0.0001


val(:,:,7) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,8) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,9) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,10) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,11) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,12) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,13) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,14) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,15) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,16) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,17) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,18) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,19) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001


val(:,:,20) =

    0.8162    0.5777   -0.0003
   -0.1709    0.9853   -0.0000
   -0.9988    0.0480    0.0001
    0.9452    0.3266    0.0001
   -0.8160   -0.5781    0.0003
    0.1705   -0.9854    0.0000
    0.9005   -0.4348   -0.0003
    0.9988   -0.0480   -0.0001
    0.9308    0.3656   -0.0002
   -0.9450   -0.3270   -0.0001
    0.5501    0.8351   -0.0008
   -0.6540    0.7565   -0.0001
$\endgroup$
  • $\begingroup$ Could you provide a sample of your dataset. The first 20 or so of each. $\endgroup$ – Edmund Mar 26 '15 at 10:42
  • $\begingroup$ I edited my question with a sample of my dataset. Thanks for your attention. $\endgroup$ – kalmanIsAGameChanger Mar 26 '15 at 11:02
  • $\begingroup$ You can export your data as a .mat file and then import it into Mathematica using Import. $\endgroup$ – C. E. Mar 26 '15 at 11:07
  • $\begingroup$ Thanks for the reply. But I would like to understand also how to create the short 'video' I am talking about in my question. $\endgroup$ – kalmanIsAGameChanger Mar 26 '15 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.