seth3dcompression
Sets compression level of the h3d file, which applies to further writings into the file.
Syntax
seth3dcompression(fid, compression_level)
Inputs
- fid
- Integer representing the file ID, returned from createh3dfile().
- compression_level
- Valid compression level is 2 to 9. A lower compression level increases the file size but reduces the writing time. A higher compression level reduces the file size and increases the writing time.
Examples
% File : test.oml
clear all; close all; clc;
num_time = 1000;
data=ones(900000,num_time);
x=cell(1,num_time);
for i=1:num_time
x(1,i)=[num2str(i)];
end
h3dfilepath=fileparts(omlfilename('fullpath'));
filename = fullfile(h3dfilepath,'test1.h3d');
fid = createh3dfile(filename);
seth3dcompression(fid,2);
tic
sid1 = createh3dsubcase(fid,'subcase1', x);
dtix1 = createh3ddatatype(fid, 'stess', 'scalar', 'elem');
writeh3ddata(fid,sid1,[1:num_time],dtix1,0,0, [1:900000] , data);
closeh3dfile(fid);
time_test1h3d=toc
filename = fullfile(h3dfilepath,'test2.h3d');
fid = createh3dfile(filename);
tic
seth3dcompression(fid,7);
sid1 = createh3dsubcase(fid,'subcase1',x);
dtix1 = createh3ddatatype(fid, 'stess', 'scalar', 'elem');
writeh3ddata(fid,sid1,[1:num_time],dtix1,0,0, [1:900000] , data);
closeh3dfile(fid);
time_test2h3d=toc