Mercurial > hg > camir-ismir2012
view toolboxes/FullBNT-1.0.7/bnt/learning/mk_tetrad_data_file.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
line wrap: on
line source
function mk_tetrad_data_file(filename, samples, sig) % MK_TETRAD_DATA_FILE Make a file containing raw discrete data for input to TETRAD % mk_tetrad_data_file(filename, samples, sig) % % samples(i,j) is the value for case i, variable j % The resulting file can be used for the 'build' part of Tetrad. % For details on tetrad, see hss.cmu.edu/html/departments/philosophy/TETRAD/tetrad.html [nsamples N] = size(samples); fid = fopen(filename, 'w'); fprintf(fid, '/Raw\n'); fprintf(fid, '%d\n', nsamples); for i=1:N fprintf(fid, 'x%d ', i); end fprintf(fid, '\n'); for i=1:nsamples fprintf(fid, '%d ', samples(i,:)-1); % tetrad counts from 0 fprintf(fid, '\n'); end %fprintf(fid, '/Knowledge\n'); %fprintf(fid, 'Significance %4.2f\n', sig); fclose(fid);