Path: news.mathworks.com!not-for-mail
From: "ching l" <chinglnc@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: : [ ] function?
Date: Sat, 19 Jul 2008 13:04:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 101
Message-ID: <g5soo2$1ej$1@fred.mathworks.com>
References: <g5sevj$ra1$1@fred.mathworks.com> <g5sgum$epd$1@fred.mathworks.com> <g5sjom$jhc$1@fred.mathworks.com> <g5sm5j$ou9$1@fred.mathworks.com>
Reply-To: "ching l" <chinglnc@hotmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216472642 1491 172.30.248.38 (19 Jul 2008 13:04:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 19 Jul 2008 13:04:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1438759
Xref: news.mathworks.com comp.soft-sys.matlab:480441



"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g5sm5j$ou9$1@fred.mathworks.com>...
> "ching l" <chinglnc@hotmail.com> wrote in message 
> <g5sjom$jhc$1@fred.mathworks.com>...
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in
> > message <g5sgum$epd$1@fred.mathworks.com>...
> > > "ching l" <chinglnc@hotmail.com> wrote in message 
> > > <g5sevj$ra1$1@fred.mathworks.com>...
> > > > this might sound stupid or simple....can I do
something like
> > > > this in matlab?
> > > > 
> > > > a= 1, 2, 3 ;
> > > > 
> > > > function(a)= [1, 2, 3] Re
> > > > 
> > > > 
> > > > is there such function?
> > > 
> > > What are you asking for? Are you asking
> > > for a function that acts like the [] operator?
> > > Horzcat is that function, or vertcat, or cat.
> > > 
> > > Are you asking for a function that returns
> > > a constant vector, or something like that? 
> > > I'm quite confused by your question.
> > > 
> > > John
> > 
> > I want to have this in a gui,whenever the call back function
> > is called, it will create something like this....
> > 
> > function pushbutton7_Callback(hObject, eventdata, handles)
> > 
> > Callback 1= [1, 2, 3])
> > Callback 2= [Callback 1: 4, 5, 6])
> > Callback 3= [Callback 2: 7, 8, 9])
> > Callback 4 = csvwrite ('string', [callback 3+ callback 4])
> > 
> > does it make sense?
> > 
> 
> Sorry, but no sense at all.
> 
> > Callback 1= [1, 2, 3])
> 
> Are you asking how to create a syntax error? ;-)
> 
> "Callback 1"
> 
> Is not the name of a valid variable in MATLAB.
> 
> Ending the line with a spare ) is also a
> good way to create a syntax error.
> 
> Likewise, I have no idea what you intend
> by the following:
> 
> > Callback 2= [Callback 1: 4, 5, 6])
> 
> Disregarding the other syntax errors I
> already mentioned, what do you want the
> colon operator to do in the middle of that
> expression?
> 
> Finally, I have no idea how this question
> bears on the subject title, which indicated
> a question about [] as a function.
> 
> Sorry, but I'm way more confused than I
> was before.
> 
> John

ahh sorry, those codes are not properly coded, it just an
expression of what I want...

Basically, the final outcome of the callback (or after the
push button is pressed) is a TEXT FILE, with the
corresponded information.

I want these  1, 2, 3, 
              4, 5, 6, 
              7, 8, 9 

to be in the text file. 

Meaning to say, when the push button is first pressed, it
will create [1, 2, 3 ], then when it's pressed again, 
it will create [1, 2, 3, ; 4, 5, 6], and then when it's
pressed again, it will create [1, 2, 3; 4, 5, 6; 7, 8, 9] so
on and so forth. Then when the final push button is pressed, 
it will create a text file with all these information in there.

Does it make sense now?

p.s. sorry, it was not supposed to be : in the previous post.