Name

ExportBaroreflexAnalysis — Export spectral analysis results into a csv or text file.

Calling Sequence

ExportBaroreflexAnalysis(res [,filetype [,filename]])

Parameters

res
A Scilab data structure returned by Baroreflex_Analysis.
filetype
a character string with possible values: csv or txt. The default value is txt.
filename
a character string with possible values: csv or txt. If this argument is omitted, a file selection dialog will open.

Description

ExportBaroreflexAnalysis can be used to export the result produced by Baroreflex_Analysis into formatted files for use in other tools like Excel, LibreOffice,...

For reuse into Scilab it is better to save these results in binary mode using the save function.

ExportBaroreflexAnalysis(res,"txt" [,filename]), generates a text file formatted into columns. The first element of each column contains the field name of the corresponding res structure followed by the formatted values of the field.

ExportBaroreflexAnalysis(res,"csv" [,filename]), generates a csv file formatted into columns. The first line contains the field names of the corresponding res structure and the following lines contains the formatted values of the fields. Line elements are separated by tabs. The decimal separator for numbers is the comma (,). cvs files can be read into Excel or LibreOffice tools.

In both cases the numbers are formatting using the current Scilab formatting. This formatting can be controlled through the format function.

Examples

Signals acquisition and filtering

    d=read(cardiovascularpath()+"demos/DATA/tilt_divers",-1,5)';//[RR SBP DBP Vt time] 
    freq_sampling=2;
    shift=600;
    RR= d(1,shift:$);
    SBP=d(2,shift:$);
    //Band pass filtering
    BP_n=355;
    BPdelay=(BP_n-1)/2;
    BP=wfir("bp",BP_n,[0.04 0.4]/freq_sampling,"hn",[0 0]);
    RR=filter(BP,1,RR);
    SBP=filter(BP,1,SBP);
    

Analysis

    clear options
    sl=64;
    options.sectionlength=sl;
    st=sl/2;
    options.sectionstep=st; //50% overlaping
    options.smoothwindowlength=5;
    options.minimalcoherence=0.5;
    fbands=[0.2 0.3];
    result=Baroreflex_Analysis(RR,SBP,freq_sampling,fbands,options)
    

Drawing

    ExportBaroreflexAnalysis(result,"txt",TMPDIR+"/foo.txt")
    editor(TMPDIR+"/foo.txt")
    // get it back
    [M,header] = fscanfMat(TMPDIR+"/foo.txt")
    

See Also

save, write_csv, fscanfMat

Authors

Serge Steer, INRIA