Export MATLAB vectors to ASCII files for plotting.
Syntax
expvect(file,v1)
expvect(file,v1,digitnum)
expvect(file,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,digitnum)
Description
The contents of the real vectors v1, v2, ... will be exported into a flat ASCII file (file), for further processing by plotting/graphing programs, or for transfer to other computers, or for sending by electronic mail, etc. The vectors will be written into an array, where the first line will contain the first elements of all the vectors and so on. The delimiter between the numbers in a row is tab. The last character in each line is a CR/LF or a CR.
digitnum defines the number of digits of the mantissa.
Default Argument Values
digitnum = 7
Examples
t = [1:100]; x = 100*ones(100,2)+rand(100,2)+j*rand(100,2);
expvect('data.txt',t,real(x(:,2)),imag(x(:,2)),8)
Diagnostics
expvect checks the vectors for complex, infinite or NaN elements, and sends an error message if any element of this kind is found.
The length of the vectors must be the same, otherwise an error message is generated.
If a file with the same name exists, the routine attempts to delete it. This can only be done if this file is in the active subdirectory/folder. If this is not the case, an error message is sent:
Cannot delete existing file ...
See Also
save
[ Previous | Help Desk | Next ]