How to import and read a large data set, with respect to time?
    3 views (last 30 days)
  
       Show older comments
    
    Sheetansh Kaushik
 on 22 Apr 2014
  
    
    
    
    
    Commented: Sheetansh Kaushik
 on 5 May 2014
            Hi! Diving straight to the question:
Values.mat when loaded into matlab reveals a 1x1 struct. Within which there are following:
Info {1x1 Struct}
X {1x1 Struct}
Y {1x31 Struct}
Description {1x1 Struct}
My data resides in the Y. When i open each struct, there is more data. Although, data of interest is only one of the data set, lets call it DATA.
DATA 1x27048
I know the total simulation time to generate DATA is 27 secs @ 0.001; i.e. each value is generated after 0.001 sec.
I have already seperated the required data from Values.mat into a seperate values_sep.mat.
My intention is to read this data set as per defined time is
TIME----Data
0.001 - value_1
0.002 - value_2 ... 0.00N - value_N.
Whenever i try to read this data in SIMULINK all get is colored lines on the scope. All other methods have also been useless(from workspace, as a 27048x2 (with time)).
Please guide me how to read this data set as per time.
THANK YOU for your patience!!
2 Comments
  Jan
      
      
 on 22 Apr 2014
				Do I understand correctly, that you explain the contents of the "Values.mat" file in detail, but the file, which is actually used, is "values_sep.mat"?
The table like description is not clear: "TIME----Data, 0.001 - value_1, ..." It is clear to you, what this should mean, but we cannot guess it. It is very strange, that trying to read the data produces colored lines. Please post the corresponding code, because we cannot guess the details.
Accepted Answer
  A Jenkins
      
 on 29 Apr 2014
        As for the 'colored lines' problem, you may have to transpose (') your matricies. To see what I mean, try this:
t = [0:0.2:10]';
x = sin(t);
In the picture below I have imported the same data once as column vectors [t,x], and once as row vectors [t',x']. One plots the sine wave "correctly", and one plots "colored lines" (which is just each time sample value of the data plotted for the duration).
If this doesn't help, perhaps you could attach a representative sample of your data?

More Answers (0)
See Also
Categories
				Find more on Sources in Help Center and File Exchange
			
	Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

