Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

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

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.

Contact us