Data processing for different size matrixes

조회 수: 6 (최근 30일)
amberly hadden
amberly hadden 2016년 4월 12일
댓글: amberly hadden 2016년 4월 20일
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
Star Strider
Star Strider 2016년 4월 12일
‘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 2016년 4월 12일
편집: amberly hadden 2016년 4월 13일
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.

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

채택된 답변

Star Strider
Star Strider 2016년 4월 12일
‘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
Star Strider
Star Strider 2016년 4월 20일
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 2016년 4월 20일
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

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calendar에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by