Extracting data from .mat file
显示 更早的评论
Hi,
I need to extract illumination and time data from a .mat file and calculate corresponding power output for a particular solar panel. Can anyone help me regarding this ?
Thanks in advance.
1 个评论
If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks).
doc load
采纳的回答
Use the load function, and specifically, Load List of Variables into Structure Array. The structure array then allows selection of specific variables within the file to import into the workspace.
11 个评论
I have 27232842x1 double data in one column of the file, having problem with the sorting and doing the calculations
I am not certain what the problem is, what the data are, or what you want to do with the data in the file.
I can provide more help with a few more details.
It is like, I got 3years of solar illumination data of a particular solar panel, now I need to calculate the output power. I need to seperate the data monthwise, and calculate the output power for a single day.
It would appear that you have a datetime variable with the data as a dependent variable.
There are several ways to deal with it, including converting it to a timetable and using the retime function, using the groupsummary function, and other approaches. Read the documentation for those and related functions (linked to in the documentation pages for those and other related functions). Start with the Timetables documentation and go from there.
thanks for the suggestion, I am going through it.. would comment again if I need more help.
As always, my pleasure!
You should be able to do it without much effort, if you already have a reasonably robust knowledge of MATLAB.
I will help as I can.
I do not have that much knowledge actually, I am just a new learner.. Thank you :)
Raisa Sharmin
2021-5-19
编辑:Raisa Sharmin
2021-5-19
Hi, im using the table2timetable function, my matlab version is R2020_b, and was following this video, but I cannot name the loaded file like this.
https://se.mathworks.com/videos/managing-time-stamped-tabular-data-with-timetable-120888.html
I do not understand thke problem you are having.
Hi, I am sharing the screenshot

As I mentioned earlier, load ‘Alison_intensity_data.mat’ in to a structure. You can then determine what is has in it, and extract it.
D = load('Alison_intensity_data.mat');
time = D.time; % Try Something Like This To Extract It
Apparently, ‘time’ is not already a table, so perhaps using the timetable function instead will be appropriate.
.
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
