Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Creating a Log, xml or text file
Date: Sun, 24 May 2009 14:25:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <gvblbv$avt$1@fred.mathworks.com>
References: <gv907h$jec$1@fred.mathworks.com> <gv9an4$84h$1@fred.mathworks.com> <gvb1nq$plr$1@fred.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1243175103 11261 172.30.248.35 (24 May 2009 14:25:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 24 May 2009 14:25:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:542173


When you open the file with fopen, you should write 'at' instead of 'wt'. 'a' stands for append.




<gvb1nq$plr$1@fred.mathworks.com>...
> Thank you for your reply. Helpped alot. But I still couldn't figure out how to append the text within the same file. 
> 
> global fid
> fid = fopen('log.txt','wt');
> fprintf(fid, 'text line number 1 \n');
> 
> Awaiting
> regards,
> 
> "Sadik " <sadik.hava@gmail.com> wrote in message <gv9an4$84h$1@fred.mathworks.com>...
> > You can definitely use the fprintf function. The help documentation should have enough explanation on that.
> > 
> > <gv907h$jec$1@fred.mathworks.com>...
> > > Hi, 
> > > 
> > > How to create a log, xml or text file?
> > > 
> > > I'm creating a small test application for my research using which images are displayed and the viewer will rate them based on particular scale. I want to save the rating/grading for each picture in a form of text file.
> > > 
> > > Can anyone help
> > > 
> > > thanks