Thread Subject: Creating a Log, xml or text file

Subject: Creating a Log, xml or text file

From: Ali Shariq Imran

Date: 23 May, 2009 14:12:01

Message: 1 of 5

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

Subject: Creating a Log, xml or text file

From: Sadik

Date: 23 May, 2009 17:11:01

Message: 2 of 5

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

Subject: Creating a Log, xml or text file

From: Ali Shariq Imran

Date: 24 May, 2009 08:50:03

Message: 3 of 5

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

Subject: Creating a Log, xml or text file

From: Sadik

Date: 24 May, 2009 14:25:03

Message: 4 of 5

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

Subject: Creating a Log, xml or text file

From: Ali Shariq Imran

Date: 24 May, 2009 16:56:02

Message: 5 of 5

Thanks I've got that sorted out


"Sadik " <sadik.hava@gmail.com> wrote in message <gvblbv$avt$1@fred.mathworks.com>...
> 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

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
fopen Ali Shariq Imran 24 May, 2009 04:54:03
fprintf Ali Shariq Imran 24 May, 2009 04:54:03
append Ali Shariq Imran 24 May, 2009 04:54:03
text file Ali Shariq Imran 23 May, 2009 10:14:02
xml Ali Shariq Imran 23 May, 2009 10:14:02
log Ali Shariq Imran 23 May, 2009 10:14:02
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com