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 15:36:02 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 21
Message-ID: <h1b2h2$n3h$1@fred.mathworks.com>
References: <h1a1qp$89c$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1245252962 23665 172.30.248.38 (17 Jun 2009 15:36:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 17 Jun 2009 15:36:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:548345


"Pete sherer" <tsh@abg.com> wrote in message <h1a1qp$89c$1@fred.mathworks.com>...
> Are there any way I can resolve this issue?
> 
> a = [1 2 3]';
> b = {'a','gg','vb'}';
> c = [34 44 98]';
> fid = fopen( 'tmp.txt', 'wt');
> fprintf( fid,'%f %s %f\n', a, b, c);
> fclose( fid);
> 
> ??? Error using ==> fprintf
> Function is not defined for 'cell' inputs.
> 
> Thank you very much.
> Pete

you could take a look at this small FEX utility, which does what you want (and much more)...

http://www.mathworks.com/matlabcentral/fileexchange/23840

us