0

I was wondering if it is possible to unzip and re-zip *.HDF.Z files in Matlab. If it is possible, would you please be so kind to tell me? Many thanks!

Here is a snip of my code at the moment.

    % Reading in multiple HDF files
    pathName = '/home//Desktop/';
    filelist = dir([pathName, '*.7A.HDF.Z']);
    for k = 1:numel(filelist)
        file_name = filelist(k).name;
        %extract(num2str(file_name));
        SD_id = hdfsd('start',file_name, 'rdonly');
        datafield_name='precipitation';
        sds_index = hdfsd('nametoindex', SD_id, datafield_name);
        sds_id = hdfsd('select',SD_id, sds_index);
jim
  • 1
  • 1
  • Have you tried [`gzip`](http://www.mathworks.es/es/help/matlab/ref/gzip.html)? Or `zip` – Luis Mendo Aug 01 '14 at 19:10
  • Well I am first trying to unzip the files. In the terminal, I can easily just use gunzip, but in matlab nothing I have tried has worked for me. I have used gunzip, unzip, and extract. – jim Aug 01 '14 at 19:17
  • You can run system commands from Matlab, using `system` or `!` – Luis Mendo Aug 01 '14 at 20:43
  • @jim I noticed that you just deleted a question. If you want to encourage people to answer that is not usually recommended. If there was a problem with the question, consider editing it instead. Otherwise, just leave it there and accept the answer. – Dennis Jaheruddin Aug 21 '14 at 15:39

0 Answers0