Data processing for different size matrixes

1 view (last 30 days)
Hello everyone, I was wondering if someone could guide me for “from where to start?” I have almost 20 data files each one is of different size (e.g., 13000*6 2000*6 5000*6 etc). Now I want to produce a 3D plot from this data. The first value in each data set is a time which is different in a sense that each data file has different time interval for readings e.g., at 0.1s, some at 0.5s interval some at 1s some at 2 etc. I tried rounding of time and to pick one data set at round figures (e.g., 1s interval) but it is affecting results because readings or at very small time intervals? I would appreciate it very much if someone could help me pass this step with possible accuracy.
  2 Comments
Star Strider
Star Strider on 12 Apr 2016
‘The first value in each data set is a time ...’
Do you mean the first row, the first column or something else?
You imply that you want to combine them. You might be able to interpolate them to the same times for all of them, depending on the data.
How would you want to plot them?
amberly hadden
amberly hadden on 12 Apr 2016
Edited: amberly hadden on 13 Apr 2016
Time is the first column and next columns are parameters i.e., results of experiments for different locations . I'm interested in producing a 3D model out of this data as I have time (or depth), lat, lon, parameter. So I need one size for all matrixes to mesh and then produce a model. Thank you star once again for being so helpful.

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 12 Apr 2016
‘So I need one size for all matrixes to mesh and then produce a model.’
I’m still not quite certain where you’re going with your data, but if you want them all to have the same time base (and all time bases begin with zero or some specific number), I would choose the smallest absolute time interval, defined by ‘t(end)-t(1)’ for each data set, define the sampling interval you want (the time difference between any two consecutive samples), and then use the interp1 function to limit them to a common time base without extrapolating.
Read the documentation for the interp1 function, experiment with it on created (not actual) data to understand how it works, then use it on your data.
If all goes well, this will work!
  22 Comments
Star Strider
Star Strider on 20 Apr 2016
My pleasure.
It’s really not that much, but it does require that you code those comparisons to do what you want them to do. I have no idea what you want to do, so I can’t offer any specific suggestions.
The first thing I would do would be to rename your ‘all’ matrix to something that does not overshadow the all function, since you may need it. You can do that in the next five minutes.
You really do need to see what your comparisons are doing, and if they are doing what you want them to. This is especially relevant to the find call. You may want to break up the find call into several different find calls, then use the appropriate set functions, such as intersect, to select the indices you want.
Best of luck on your finals! I’m certain you will do well!
amberly hadden
amberly hadden on 20 Apr 2016
Thank you star I needed this to produce results for a presentation and if I spend time on it I would not be able to prepare for exams. The surprising thing is the program I sent you with the exception of 'all' is working for some other data set which means I'm having some error in defining intervals of may be missing something perhaps mesh(x,y,z)? or something else may be. I would work on it after exam. Best regards, Amb

Sign in to comment.

More Answers (0)

Categories

Find more on Data Preprocessing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!