RTXI 1.3
hdf/RTXIh5_MATLAB/example.m
Go to the documentation of this file.
00001 %% get basic file info
00002 clear; clc
00003 
00004 fname = 'testGwaveform.h5';
00005 
00006 fileinfo = rtxi_read(fname);
00007 trial1 = getTrial(fname,1);
00008 % trial2 = getTrial(fname,2);
00009 % trial3 = getTrial(fname,3);
00010 %printParameters(fname,1);
00011 
00012 
00013 %% browse a HDF5 file starting with a particular trial
00014 clc
00015 close all
00016 rtxifig = rtxibrowse(fname,1);
00017 % rtxifig2 = rtxibrowse('new',fname,2);
00018 
00019 %% browse a HDF5 file starting with a particular trial, reusing a figure
00020 % handle
00021 
00022 rtxifig = rtxibrowse(rtxifig,fname,2);
00023 
00024 
00025 %% add some data to the hdf5 file
00026 
00027 file = H5F.open(fname,'H5F_ACC_RDWR', 'H5P_DEFAULT');
00028 
00029 % add a dataset
00030 dset = single(rand(10,10));
00031 dset_details.Location = '/Trial1';
00032 dset_details.Name = 'Random';
00033 
00034 
00035 hdf5write(fname, dset_details, dset, 'WriteMode', 'append')
00036 
00037 % get the dataset back out
00038 hdf5read(fname,'/Trial1/Random')
00039 
00040 H5F.close(file);
00041 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines