How to import and read a large data set, with respect to time?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Jan
2014-4-22
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.
采纳的回答
A Jenkins
2014-4-29
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?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!