Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Writing text file with double and string on the same row
Date: Wed, 17 Jun 2009 18:44:02 +0000 (UTC)
Organization: Erasmus MC
Lines: 12
Message-ID: <h1bdhi$38l$1@fred.mathworks.com>
References: <h1a1qp$89c$1@fred.mathworks.com> <h1aatd$l9h$1@fred.mathworks.com> <h1b1kt$od2$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1245264242 3349 172.30.248.37 (17 Jun 2009 18:44:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 17 Jun 2009 18:44:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870065
Xref: news.mathworks.com comp.soft-sys.matlab:548404


"Pete sherer" <tsh@abg.com> wrote in message <h1b1kt$od2$1@fred.mathworks.com>...
> I was trying to find a way to write it without using loop.
> Any hints?

Sure, if you insist ...

A = [num2cell(a) b num2cell(c)].' ; % do not forget to transpose ...
fprintf('%f %s %f\n',A{:})

imho this is less readable and prone to errors

Jos