Path: news.mathworks.com!not-for-mail
From: "Ryan " <ryanhutten2012@u.northwestern.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Creating user entry form GUI
Date: Wed, 30 Jun 2010 15:03:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <i0fmb9$2h9$1@fred.mathworks.com>
References: <i0dk91$dci$1@fred.mathworks.com> <i0e8it$oed$1@fred.mathworks.com>
Reply-To: "Ryan " <ryanhutten2012@u.northwestern.edu>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1277910185 2601 172.30.248.37 (30 Jun 2010 15:03:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 30 Jun 2010 15:03:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1521337
Xref: news.mathworks.com comp.soft-sys.matlab:649353

"Sadik " <sadik.hava@gmail.com> wrote in message <i0e8it$oed$1@fred.mathworks.com>...
> Hi Ryan,
> 
> As soon as you say
> 
> fid = fopen('yourFile.txt','w');
> 
> the contents of your file will be deleted. Now you can go ahead and write anything you want using fprintf.
> 
> Best.

Thanks. Is there a way that I can just create a few variables in the txt file that will be updated based on the user input? I do not want to delete the entire text file, i just want to replace 3 individual variables that are repeated several times throughout the text file. I know on linux there is a function called "read" which replaces variables in this manner. Are you aware of a similar matlab function?