Taking input from large excel data stored in multiple sheets based on different variables.
2 次查看(过去 30 天)
显示 更早的评论
I have a big excel data for temperature of different location based on variables month, wind speed, humidity etc.
- we have measure temperature in every month at least once. Total 12 values.
- humidity values varies from 30% to 70%
- wind speed also changes from 0 m/s to 30 m/s Since data are based on different variables so I have stored data in different sheets.
Based on variable value i named each sheet in a specific way. Ex. 1. V_10_50 (formate month_windspeed_humidity) This sheet name specifies that month is a variable and temperature measured when in each month wind speed is 10m/s and humidity is 50% 2. Jan_V_50 This name specified that in January month when humidity is 50% we measure temperature at different wind speed.
In am similar way i have store data in excel. Can you suggest me a better way access these data from excel in order to interpolate temperature value for every possible combination of month, wind speed and humidity.
0 个评论
回答(1 个)
Dave B
2021-10-10
If you look at the documentation for readtable you'll see that you can read a sepcific sheet name from an excel spreadsheet.
To put together a string that you'll pass to this function, there are lot's of options, and it probably depends a little bit on how your data is stored in matlab. For instance:
a='Jan';
b=10;
c=50;
join([string(a) string(b) string(c)],'_')
sprintf('%s_%d_%d', a, b, c)
If your question is more about how to rethink your excel organization - you can import a lot of data pretty quickly. So is it maybe more convenient to keep month, wind speed, humudity as columns of one big sheet and just import it all at once to MATLAB? I generally think it's more easy to get subsets and move data around in MATLAB than excel, because you can automate it so easily with code, so if I can get all my data there early it's easier than multiple rounds of importing. But that may be because I have lots of experience. Either way, if you can separate out file IO from data processing that seems good!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!