Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Issues Writing to File
Date: Sat, 07 Nov 2009 07:58:45 -0600
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <hd3uer$cnn$1@news.eternal-september.org>
References: <hd3sl1$esl$1@fred.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.eternal-september.org U2FsdGVkX18pvwAvSVdAY62uXCw0XRNM16psshHOGU+p0loCPxinPDAYEAFQwIYRU+tfGNwaqD1oGk1wT/M1OO3N2m//XyPBxyPJinLyev/o9I5rwtXHIyG5mGmYwa0uGUztwWx1WzI=
X-Complaints-To: abuse@eternal-september.org
NNTP-Posting-Date: Sat, 7 Nov 2009 13:58:52 +0000 (UTC)
In-Reply-To: <hd3sl1$esl$1@fred.mathworks.com>
X-Auth-Sender: U2FsdGVkX1+d3iUvgxDc/GafIJKnC4vYvog5PVlyouE=
Cancel-Lock: sha1:k+6sNZar46xwiTq96f1IeHgl5+Y=
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
Xref: news.mathworks.com comp.soft-sys.matlab:583212


Ashley wrote:
> I'm having trouble writing to a file using fprintf. The issues is I
> need to write lines like:
> fprintf('     name='C:/Documents and ...

...

 >> sprintf('%s','It''s an embedded ''.')
ans =
It's an embedded '.
 >>

Double up on the apostrophes is one way; another is to insert the 
numeric values w/ strrep in an existing string at a desired location or 
use strcat or , to build the string.

 >> pstrphe = double('''')
pstrphe =
     39
 >>  char(pstrphe)
ans =
'
 >> s = ['That', char(pstrphe), 's a string.']
s =
That's a string.
 >>

for example.  repmat() sometimes comes in handy for repeated strings as 
well.

help strfun

to see the full ML repertoire from which to choose...

BTW, I assume you did get the max stress data read correctly?

--