Skip to content

Commit

Permalink
Add .mat file for HDF5-TDMS-object unit tests to run.
Browse files Browse the repository at this point in the history
- Adds scripts to reproduce this data, so in theory a new user can run a short MATLAB script to reproduce this
- Had a play with trying to get setup-matlab to run these scripts before the unit tests, but alas, no.
  • Loading branch information
willGraham01 committed May 3, 2023
1 parent 1fd2722 commit 4ac74b0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Binary file not shown.
19 changes: 19 additions & 0 deletions tdms/tests/unit/hdf5_io_tests/create_structure_array.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
%% This script creates the structure_array.mat file for use in the hdf5 tests for reading in structure arrays.
close all;
clear;

example_struct = struct();

example_struct.double_no_decimal = 1.;
example_struct.double_half = 0.5;
example_struct.string = 'tdms';
example_struct.boolean = true;
example_struct.uint_345 = uint8(ones(3, 4, 5));
example_struct.double_22 = [0.25, 0.5; 0.75, 1.];
example_struct.complex_22 = [0., -1.i; 1.i, 0.];

%% save variables to the file we need
% Save the files to the expected filename for the unit tests to read the
% data back in.

save("structure_array.mat", "example_struct", "-v7.3");

0 comments on commit 4ac74b0

Please sign in to comment.