Has anyone ever used MATLAB? If you have, can you point me to any functions that are equivalent to DoEvents in VB?
I have a while loop, but the user can't press any buttons while that loop is active...and so the loop can't be terminated.
Thanks.
Printable View
Has anyone ever used MATLAB? If you have, can you point me to any functions that are equivalent to DoEvents in VB?
I have a while loop, but the user can't press any buttons while that loop is active...and so the loop can't be terminated.
Thanks.
Why are you asking in Chit Chat? You know you wont get a serious answer.
We havn't really got a special forum for this do we?
EDIT - do you think the mods will be mad if I ask in Gen VB?
I seem to remember that there is a sleep() command in matlab
Do you honestly think we take this job so seriously we actually get worked up and mad about people posting in the wrong forums ? ;)Quote:
Originally posted by nishantp
EDIT - do you think the mods will be mad if I ask in Gen VB?
Might try General PC if its not directly VB related. Its just too easy for people to give you a silly answer here, so thats why i said something. :p
Is this a grahics/drawing issue? If it is you could use the drawnow function (see HELP DRAWNOW)
Most people want fast calculations so Matlab runs its calculations at
normal priority. If you are willing to give Matlab less access to the
CPU (thus increasing calculation time) you can change the priority
(how to do this depends on your operating system)
Since it's not in the documentation, they might have taken it out of the newer versions of MATLAB (they've done a lot of that:rolleyes: ), but thanks:).Quote:
Originally posted by PeteD
I seem to remember that there is a sleep() command in matlab
Cander and Plenderj - Ok I'm going to ask in Gen VB then, thanks.
see my edited post above
Its a fairly simple situation...but I'm new to MATLAB. Sometimes I think I should have done it in VB.Quote:
Originally posted by PeteD
Is this a grahics/drawing issue? If it is you could use the drawnow function (see HELP DRAWNOW)
Most people want fast calculations so Matlab runs its calculations at
normal priority. If you are willing to give Matlab less access to the
CPU (thus increasing calculation time) you can change the priority
(how to do this depends on your operating system)
All i'm doing it putting a play and a stop button. The Play button activated a loop that plays a waveform, (with wavplay()) until the user presses Stop. But the user can't press stop while the loop is running, which presents the problem. A DoEvents like function would be perfect.
They introduced timers in one of the fairly recent versions of matlab I think.
Does your VB code interact with you matlab code? Could you put doevents in your VB code?
No no, Its all being done in MATLAB. And as far as I know, MATLAB can only interact directly with C and C++.Quote:
Originally posted by PeteD
They introduced timers in one of the fairly recent versions of matlab I think.
Does your VB code interact with you matlab code? Could you put doevents in your VB code?
I think you have to use windows messages to interact with matlab code. I'm not a matlab expert by any means, but have worked on a VB app that integrated with matlab code. A collegue did all the matlab integration work, but I'm sure he ended up posting windows messages.
First of all, thanks for the help. What exactly do you mean by 'windows messages'?
Some info here, but I'd reccomend you search googleQuote:
Originally posted by nishantp
First of all, thanks for the help. What exactly do you mean by 'windows messages'?
http://www.exaflop.org/docs/vbsubclass/ind.html
have a look on www.mathworks.com, some good matlab info here
and here
http://www.mathtools.net/MATLAB/Refe.../Visual_Basic/
It seems that even though it had nothing to do with graphics, DrawNow() does the job. Thanks everyone.