Access Keys:
Skip to content (Access Key - 0)

write_var()

Writes dataset variables to a file

Syntax y = write_var(FileName, WriteMode, Comment, Delimiter, Format, Precision, Var1, Var2,...,VarN)

Arguments
Name Description Range Type Default Required
FileName Name of the output file   string   yes
WriteMode Describes the write mode - overwrite or append "W"|"A" † string   yes
Comment Text to be written at the top of the file   string "" no
Delimiter Delimiter that separates the data (any character string can be used; the default delimiter is a space)   string " " no
Format Format of the data "f"|"s" ‡ string "f" no
Precision precision of the data [1, 64] integer 6 no
Var1,...,VarN Data variables to be written   dataset variable   yes
† WriteMode: "W" - overwrite the file, "A" - append to the file ‡ Format: "f" - full notation, "s" - scientific notation

Examples

write_var_f = write_var("output_S21.txt","W","! 
     Freq real(S21) imag(S21)"," ", "f", ,freq, S21) 
writes S21 to the output file output_S21.txt as:
! Freq real(S21) imag(S21)
1000000000 0.60928892074273 -0.10958342264718 
2000000000 0.52718867597783 -0.13319167002392
3000000000 0.4769067837712 -0.12080489345341 
wv_ib=write_var("output_hbIb.txt","W","! HB Ib.i", " ", "f", freq, Ib.i)
write the Harmonic Balance frequency and current Ib.i to the
     output file output_hbIb.txt.

Defined in

$HPEESOF_DIR/expressions/ael/utility_fun.ael

See Also

indep()

Notes/Equations

This function can be used to write multiple dataset variables to a file. Currently only 1 dimensional data is supported. All variables that are to be written must be of the same size. Each variable data is written in column format. Complex data type is written in 2 columns as real and imaginary.

Adaptavist Theme Builder Powered by Atlassian Confluence