Path: news.mathworks.com!not-for-mail
From: "us " <us@neurol.unizh.ch>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Complex structure to text file
Date: Thu, 9 Aug 2007 21:50:25 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 20
Message-ID: <f9g271$3fo$1@fred.mathworks.com>
References: <f9fq2l$2vi$1@fred.mathworks.com>
Reply-To: "us " <us@neurol.unizh.ch>
NNTP-Posting-Host: webapp-01-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1186696225 3576 172.30.248.36 (9 Aug 2007 21:50:25 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 9 Aug 2007 21:50:25 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:423281


Anthony:
<SNIP textual complexity...

one of the many solutions

% the data
     fnam='foo.txt'; % <- your file name
     rr=pi*(1:10);
     ii=1:numel(rr);
     c=complex(rr.',ii.');
% the engine
     dlmwrite(fnam,c,...
             'delimiter','\t',...
             'precision','%.4f   %.1f i');
% the result
     c
     type(fnam)

us