Page 1 of 1

Input filenames as ascii output?

Posted: Wed Feb 13, 2013 13:10
by uffeaf
First of all, thank you for this fine software package.

I'm running the crqa, and I've gor the RQA measures and computational parameters written to an ascii file by means of the matlab command fprint, e.g. the line

Code: Select all

fprintf(fileID, 'RR\t%s\r\n', RR);
prints RR and the RR vlue to a text file.

How do I get the input filenames (vectors X and Y) written to the ascii output file?

Regards, Uffe

Re: Input filenames as ascii output?

Posted: Thu Feb 21, 2013 21:19
by Norbert
I'm a bit confused by mixing filename and the vectors X and Y. What do your really would like to do? Just to save the original time series along the RQA measures?

Re: Input filenames as ascii output?

Posted: Fri Feb 22, 2013 09:22
by uffeaf
The time series X and Y used for input have names, e.g. X='NEO1B34100011 (2012-08-30)RAW.csv' Y='NEO1B34100011 (2012-08-31)RAW.csv'.

I'd like to have the names of these time series included in the output ascii file along with the RQA results.

Re: Input filenames as ascii output?

Posted: Mon Feb 25, 2013 20:35
by Norbert
Hi,

I would do it like this

Code: Select all

% calculate the RQA measures
w = 200;
ws = 100;
R = crqa(X,1,2,3,w,ws);

% open results file for writing
fid = fopen('resultsfile.dat','w');

% write the filenames in the file
fprintf(fid,'file X: %s\nfile Y: %s\n',X,Y);

% write the head line (variable names)
fprintf(fid,'\nRR\tDET');
for i = 1:ws:size(R,1)
   fprintf(fid,'%0.5f\t%0.5f\n',R(i,1),R(i,2));
end

% close the file
fclose(fid);
I hope it helps.