Make a tensor with nc images?
Show older comments
Hello, I´m trying to make a Tensor with satellite images of Chloroplyll. I have a script to make a tensor but It´s for hdf images and since juanury the NOAA changed the format, now are nc. I have this errors: Error using hdfquickinfo (line 15) HDF file 'C:\Maestria\Imagenes\Clo\clo200801.mat' may be invalid or corrupt.
Error in hdfread>dataSetInfo (line 356) hinfo = hdfquickinfo(filename,dataname,params);
Error in hdfread (line 209) [hinfo,params] = dataSetInfo(varargin{:});
Error in oceancolor (line 53) nl = double(cell2mat(hdfread(hdffile,'Number of Lines'))); %No de lineas de lat
Error in Tensor (line 16) [data,lon,lat,dndate, units, parameter]=oceancolor(archi,lonlims,latlims);
I think I need a different function, but I have no idea what It could be. Thanks so much for your help!
Accepted Answer
More Answers (2)
Chad Greene
on 1 Oct 2015
Ah, .mat files are Matlab's own file format. The nice thing about .mat files is that they're super easy to work with when you use Matlab. The bad thing about .mat files is they're very frustrating for people who do not use Matlab because .mat files are not human readable. Luckily you're using Matlab so you should be able to just say
load clo200801.mat
And then the variables will be in your workspace.
Kelly Kearney
on 1 Oct 2015
0 votes
How were the .mat files generated? Version 7.3 .mat files (created using the -v7.3 argument with save) are technically hdf5 files, so they could be read via the hdf-related functions ( load is probably easier, but hdfread may make sense for your application). However, the default Version 7 .mat files are a different binary format, so those can only be read via load.
My guess is your old .mat files were saved with the -v7.3 flag, and your new ones weren't.
1 Comment
Lilia A.L.
on 1 Oct 2015
Categories
Find more on NetCDF in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!