Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!newsfeed00.sul.t-online.de!t-online.de!news.k-dsl.de!aioe.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: reading complex marix from file
Date: Fri, 14 Nov 2008 13:41:27 -0600
Organization: Aioe.org NNTP Server
Lines: 28
Message-ID: <gfkkh9$7v2$1@aioe.org>
References: <gfk5ne$hti$1@fred.mathworks.com> <22127978.1226688196873.JavaMail.jakarta@nitrogen.mathforum.org> <gfkhrg$sbe$1@aioe.org> <YkkTk.3036$Wd1.929@newsfe06.iad>
NNTP-Posting-Host: w+HkXSfYin7NYfNeZY1PGQ.user.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
NNTP-Posting-Date: Fri, 14 Nov 2008 19:45:46 +0000 (UTC)
X-Notice: Filtered by postfilter v. 0.7.4
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
Xref: news.mathworks.com comp.soft-sys.matlab:500893


Walter Roberson wrote:
> dpb wrote:
>> G0Y wrote:
>>> Not really.
>>>
>>> Let us clarify: I have a .txt file containing complex numbers in one
>> column. I want to read it into a matrix. Anyway as I see there is no
>> chance to fulfill this method :((
> 
>>  >> c = complex(sscanf('1+2i 3-4.5i -6.7+8i','%f %fi',[2,3])')
>> c =
>>     1.0000    2.0000
>>     3.0000   -4.5000
>>    -6.7000    8.0000
> 
> I believe that G0Y would instead be hoping for the answer that would be 
> given by
> 
>>> t = sscanf('1+2i 3-4.5i -6.7+8i', '%f %fi',[2 3]).';
>>> c = complex(t(:,1),t(:,2))
...

Yeah, should've read complex() helpfile for refresher--I was thinking it 
would take the two alternating components of a automagically -- seems a 
little brain-dead in its operation but guess it does follow Fortran 
CMPLX() intrinsic on reflection from which (I presume) it was derived...

--