"ching l" <chinglnc@hotmail.com> wrote in message
<g5n6am$78p$1@fred.mathworks.com>...
> In Gui, how do I command the callback function to go to
the
> next function?
>
> For example, when I first press the button, it will go
to this,
>
>
> function answer_faster_Callback(hObject, eventdata,
handles)
> csvwrite('subject1.dat',[1;00;55]);
>
>
> then when I press again, it will go to this,
>
> csvwrite('subject2.dat',[3;5;6]);
>
>
> Possible to do that?
>
> Thanks.
yes, just save where you ere in the handles or a global
variable and do the next thing each time.
In article <g5n6am$78p$1@fred.mathworks.com>,
ching l <chinglnc@hotmail.com> wrote:
>In Gui, how do I command the callback function to go to the
>next function?
>For example, when I first press the button, it will go to this,
function answer_faster_Callback(hObject, eventdata, handles)
persistent fargs
if isempty(fargs)
fargs.args = {{'subject1.dat',[1;00;55]}, {'subject2', [3;5;6]}, ...
{'subject3.dat',[17;8;21]}, {'subject4', [255;0;255]};
fargs.count = 1;
end
csvwrite(fargs.args{fargs.count,1}, fargs.args{fargs.count,2});
fargs.count = fargs.count + 1;
if fargs.count > length(fargs.args)
set(hObject, 'Callback', '');
end
end
--
Q: Why did the chicken cross the Mobius strip?
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <g5r2ls$4l8$1@canopus.cc.umanitoba.ca>...
> In article <g5n6am$78p$1@fred.mathworks.com>,
> ching l <chinglnc@hotmail.com> wrote:
> >In Gui, how do I command the callback function to go to the
> >next function?
>
> >For example, when I first press the button, it will go to
this,
>
> >function answer_faster_Callback(hObject, eventdata, handles)
> >csvwrite('subject1.dat',[1;00;55]);
>
> >then when I press again, it will go to this,
>
> >csvwrite('subject2.dat',[3;5;6]);
>
> >Possible to do that?
>
> Yes,
>
> function answer_faster_Callback(hObject, eventdata, handles)
> persistent fargs
> if isempty(fargs)
> fargs.args = {{'subject1.dat',[1;00;55]}, {'subject2',
[3;5;6]}, ...
> {'subject3.dat',[17;8;21]}, {'subject4',
[255;0;255]};
> fargs.count = 1;
> end
>
> csvwrite(fargs.args{fargs.count,1},
fargs.args{fargs.count,2});
> fargs.count = fargs.count + 1;
> if fargs.count > length(fargs.args)
> set(hObject, 'Callback', '');
> end
> end
> --
> Q: Why did the chicken cross the Mobius strip?
>
> A: There were manifold reasons.
I got some changes of this...not very sure how to work it out...
Is it possible to retain the previous value of the callback?
something like this, but I know this is not right. I want
the callback to store the previous count value and store in
current count value
This would set up network address, then to return to the kind of data transmission, is how the application of this » That this is the first to write themselves a callback function, and then set up the callback function to libcurl Curry, and then specify what kind of format to receive data, when libcurl to return to the data will set the callback function. Are as follows:
Callback function definitions:
size_t write_data (void * buffer, size_t size, size_t nmemb, void * userp);
Set up a callback function:
curl_easy_setopt (easyhandle, CURLOPT_WRITEFUNCTION, write_data);
Set up a callback function to receive the data format:
curl_easy_setopt (easyhandle, CURLOPT_WRITEDATA, & internal_struct);
Through the above settings, you can receive data to the callback function inside, then how is the kind libcurl command to start the download data or upload the data? » Below on the function curl_easy_perform, this function is to connect remote sites, began operating agreements related to the order, calling the examples are as follows:
success = curl_easy_perform (easyhandle);
Above through a series of calls, you can connect with the HTTP server and download the data and reached in the callback function. When finished using the library after this, do not forget to call functions curl_global_cleanup () to do the removal work.
"ching l" <chinglnc@hotmail.com> wrote in message
<g63si1$5h5$1@fred.mathworks.com>...
> roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> message <g5r2ls$4l8$1@canopus.cc.umanitoba.ca>...
> > In article <g5n6am$78p$1@fred.mathworks.com>,
> > ching l <chinglnc@hotmail.com> wrote:
> > >In Gui, how do I command the callback function to go to the
> > >next function?
> >
> > >For example, when I first press the button, it will go to
> this,
> >
> > >function answer_faster_Callback(hObject, eventdata,
handles)
> > >csvwrite('subject1.dat',[1;00;55]);
> >
> > >then when I press again, it will go to this,
> >
> > >csvwrite('subject2.dat',[3;5;6]);
> >
> > >Possible to do that?
> >
> > Yes,
> >
> > function answer_faster_Callback(hObject, eventdata, handles)
> > persistent fargs
> > if isempty(fargs)
> > fargs.args = {{'subject1.dat',[1;00;55]}, {'subject2',
> [3;5;6]}, ...
> > {'subject3.dat',[17;8;21]}, {'subject4',
> [255;0;255]};
> > fargs.count = 1;
> > end
> >
> > csvwrite(fargs.args{fargs.count,1},
> fargs.args{fargs.count,2});
> > fargs.count = fargs.count + 1;
> > if fargs.count > length(fargs.args)
> > set(hObject, 'Callback', '');
> > end
> > end
> > --
> > Q: Why did the chicken cross the Mobius strip?
> >
> > A: There were manifold reasons.
>
>
> I got some changes of this...not very sure how to work it
out...
>
Is it possible to retain the previous value of the
callback? something like this, but I know this is not right.
I want the callback to store the previous count value and
store in current count value
> Is it possible to retain the previous value of the
> callback? something like this, but I know this is not right.
> I want the callback to store the previous count value and
> store in current count value
>
>
> handles.scount= 1;
> handles.scount= handles.scount+1;
>
> handles.sc{handles.scount}= [handles.id,
> (handles.randValue), 2]
>
> handles.s = [handles.sc{handles.scount};
> handles.sc{handles.scount-1}]
>
> guidata(hObject, handles);
>
>
> it still doesn't return the previous count value..any idea how?
Get rid of the semicolons so you can see what's happening. Look at the
all the values on each click, figure out what isn't changing the way you
want, fix it, and try again.
In article <8001046.1216714882627.JavaMail.jakarta@nitrogen.mathforum.org>,
dreammissu <yushun1988829@gmail.com> wrote:
>This would set up network address, then to return to the kind of data
>transmission, is how the application of this
dreammissu, is that a reply to the previous discussion, or did you happen
to start a new discussion under an old title? If you were starting
a new discussion, then I could not make out what your question was?
--
"What is important, then, is not that the critic should possess a
correct abstract definition of beauty for the intellect, but a
certain kind of temperament, the power of being deeply moved by
the presence of beautiful objects." -- Walter Pater
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.