Regarding "Saving the data"?

2 views (last 30 days)
Ara
Ara on 17 Jan 2017
Commented: Walter Roberson on 20 Jan 2017
Dear All,
I am getting data from NETCDF files as follows:
time=double(netcdf.getAtt(ncFileId,netcdf.getConstant('NC_GLOBAL'),'time'));
data1=...
dat2=..
..
etc
And then save it like this:
data=[time data1 data2..];
data=double(data);
And then it will save as follows:
save(matfile,'data')
But, the data that came out from this is not completed. I mean the size of each matfile that save in this way is around 80k. While it should be ~3000-5000k. So, I am missing some data.
Does anyone knows how to resolve my problem?
I would greatly appreciate your help, Ara

Accepted Answer

Walter Roberson
Walter Roberson on 17 Jan 2017
You cannot rely on file size to tell you whether data is missing. Current MATLAB .mat files may contain compressed data. You should use "whos -file" on the file to look to see what variables are in the file and their sizes.
  20 Comments
Ara
Ara on 20 Jan 2017
Edited: Ara on 20 Jan 2017
Thank you for useful documents/links. It helps me to understand. Can I ask you one question? I understand that I can get timetable so that I can arrange time based on hour, which is great. For this, I need to arrange other data based on that as well.
This means that:
Time=seconds(1:3600)'; % this will give me data in one hour. Am I right?
T=timetable(Time, [data in column 1], [data in column 2],...,[data in column 8], 'Variable Names', {'A', 'B',...'H'});
But, my problem is how get 3600 data in column A, as an example, as well? I would know the first 3600 from time represents an hour and then I need to get one hour data, too. So that I can hourly do the analysis.
Can you please give me a hint?
Thank you for all of your great help,
Walter Roberson
Walter Roberson on 20 Jan 2017
retime(T, 'hourly', 'mean') perhaps

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!