Extracting data from structure arrays within a structure array
显示 更早的评论
I don’t know if this can be done.
So I have a 1X100 structure array called "data1" Each element IN "data" is 1X1 structure. In each of those 1X1 structure I have the following categories:
Field: id, type, time, temp Value data example: '1230', 'thermometer', a 1X24 double containing the times that the measurements were taken, and a 1X24 double (containing the measurements).
For each of the 1X1 structure elements in "data1", the "id" Field is always contains a Value that is a string of numbers or letters. The "type" Field always contains a Value that is a string of letters spelling out what the measuring device is (aka: a thermometer, a thermocouple, etc). The times and measurements Fields contain anywhere from a 1X24 double all the way up to a 1X243 double.
Each measurement of temperature was taken over a 24 hour period. Some were taken every 7-10 minutes, some were taken every hour.
What I need to do is a few things:
- Extract all the times and temperature measurements from this structure array for each of the different locations specified by "id"
- take ANY of the structure elements from data1 that contains a time and measurement field which has Values of 1X24, then append ALL the other times and temperatures to the times of THAT structure element.
- I would want to end up with two matrices of data:- A 24X100 matrix with all the times- A 24X100 matrix with all the corresponding temperatures.
If anyone has an easier method of doing this, please help me out. Also, if somebody knows how I could do this impossible (for me) problem, let me know
Any help is extremely appreciated. Mike
2 个评论
Sara
2014-7-10
Are you reading in the value from a file or do you load the structure?
Michael Ant
2014-7-11
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!