Added a Matlab utility function to save CA data in a (relatively) efficient data format, since Matlab will only save doubles for ascii format.

This commit is contained in:
jlizier 2017-08-30 15:39:59 +10:00
parent c2b1f7ef25
commit 257ef285d3
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
%
% Utility function to save raw CA data to a text file format.
% Unfortunately MAtlab's -ascii format only writes full doubles, making much larger files than we need.
% So I wrote this.
function saveCA(filename, caStates)
warning('off','MATLAB:Java:DuplicateClass');
javaaddpath('../../../infodynamics.jar');
addpath('..');
arrayWriter = javaObject('infodynamics.utils.ArrayFileWriter');
arrayWriter.makeIntMatrixFile(octaveToJavaIntMatrix(caStates), filename);
end