ExportSpectralAnalysis — Export spectral analysis results into a csv or text file.
ExportSpectralAnalysis(res [,filetype [,filename,InputNames]])
csv
or txt
or an empty
matrix.If this argument is omitted or empty the default
value is txt
.
csv
or txt
or an empty matrix. If this
argument is omitted or empty , a file selection dialog will open.
["RR","Vt"]
.
ExportSpectralAnalysis
can be used to export
the result produced by CDM_Analysis, SPWVD_Analysis or CDM_SPWVD_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.
ExportSpectralAnalysis(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.
ExportSpectralAnalysis(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.
d=read(cardiovascularpath()+"demos/DATA/decubitus_03",-1,4)'; //read the data freq_sampling=4; RR=d(1,:);//RR signal Vt=d(3,:);//Tidal Volume signal //narrow band filter filterlength=355; frequency_bounds=[0.25 1.9]; result=CDM_SPWVD_Analysis(RR,Vt,freq_sampling,frequency_bounds,filterlength) ExportSpectralAnalysis(res,"txt",TMPDIR+"/foo.txt") editor(TMPDIR+"/foo.txt") // get it back [M,header] = fscanfMat(TMPDIR+"/foo.txt")