Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: string extra character?
Date: Fri, 18 Jul 2008 23:22:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 45
Message-ID: <g5r8iq$im9$1@fred.mathworks.com>
References: <g5r3jd$s4u$1@fred.mathworks.com> <g5r50a$7ro$1@canopus.cc.umanitoba.ca> <g5r7iv$aus$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1216423322 19145 172.30.248.35 (18 Jul 2008 23:22:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 18 Jul 2008 23:22:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 939004
Xref: news.mathworks.com comp.soft-sys.matlab:480401



"ching l" <chinglnc@hotmail.com> wrote in message
<g5r7iv$aus$1@fred.mathworks.com>...
> roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> message <g5r50a$7ro$1@canopus.cc.umanitoba.ca>...
> > In article <g5r3jd$s4u$1@fred.mathworks.com>,
> > ching l <chinglnc@hotmail.com> wrote:
> > >a= 80;
> > >csvwrite(num2str(a), [2]);
> > 
> > >the result = 80.dat
> > 
> > >what can I do so that the file name can be 80_1?
> > 
> > csvwrite(num2str(a,'%d_1.dat'),[2]);
> > -- 
> >   "If there were no falsehood in the world, there would
be no
> >   doubt; if there were no doubt, there would be no
> inquiry; if no
> >   inquiry, no wisdom, no knowledge, no genius."
> >                                               -- Walter
> Savage Landor
> 
> 
> i really can't see anything wrong with the codes below, 
> it has the bracket unbalanced error, but it has 4 pairs
> brackets which is right....
> 
> csvwrite ((num2str(ceil(handles.randValue)),'%d_1.dat'), [1]);
> 
> 
> 



Just because you have 4 of each doesn't mean it makes
sense... you have the wrong number of arguments for your
functions. You need this:

csvwrite(num2str(ceil(handles.randValue),'%d_1.dat'), [1]);

Also the square brackets arent doing anything. Though it
seems like you want something other than "1" for your last
argument anyway... you realize this will just output a text
file with the number 1 in it, right?