Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe06.iad.POSTED!7564ea0f!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
Organization: Canada Eat The Cookie Foundation
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: reading complex marix from file
References: <gfk5ne$hti$1@fred.mathworks.com> <22127978.1226688196873.JavaMail.jakarta@nitrogen.mathforum.org> <gfkhrg$sbe$1@aioe.org>
In-Reply-To: <gfkhrg$sbe$1@aioe.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 25
Message-ID: <YkkTk.3036$Wd1.929@newsfe06.iad>
NNTP-Posting-Host: 24.79.146.116
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe06.iad 1226691000 24.79.146.116 (Fri, 14 Nov 2008 19:30:00 UTC)
NNTP-Posting-Date: Fri, 14 Nov 2008 19:30:00 UTC
Date: Fri, 14 Nov 2008 13:30:21 -0600
Xref: news.mathworks.com comp.soft-sys.matlab:500891


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))

c =

                          1 +                     2i
                          3 -                   4.5i
                       -6.7 +                     8i