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!

 채택된 답변

Chad Greene
Chad Greene 2015년 9월 29일

0 개 추천

I think you need ncread rather than hdfread. NetCDF and HDF formats are quite similar, but there are some minor differences between the two. The transition from HDF to NetCDF should be relatively painless.

댓글 수: 1

Lilia A.L.
Lilia A.L. 2015년 9월 30일
Thanks for your help! Actually my files are .mat, we made an orthorectification because are from level 1. Should I change the files to NetCDF? I´m new with MatLab!!!

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Chad Greene
Chad Greene 2015년 10월 1일

0 개 추천

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
Kelly Kearney 2015년 10월 1일

0 개 추천

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

Lilia A.L.
Lilia A.L. 2015년 10월 1일
All the files were generated with the -v7.3 argument with save.
I think I got It! Thanks!

댓글을 달려면 로그인하십시오.

질문:

2015년 9월 29일

댓글:

2015년 10월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by