Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Qbasic programm into matlab??

188 views
Skip to first unread message

Marcus

unread,
Sep 29, 2005, 12:00:34 AM9/29/05
to
Hey!!

I have to simulate a closed controll loop for some controlled
systems. My colleague has already written a code in Qbasic (good old
programming!) for the controller....but we want to simulate it in
matlab-simulink....so is there a possibility to run the qbasic code
in matlab ....or mybe I can run it in C++ and convert it than to a
mfile!! How easy or difficult would it be to transform the Qbasic
code into a matlab m-file?

It would be great when anybody could give me a hint or a solution...

cheers

Marcus

Ian Cowley

unread,
Sep 29, 2005, 4:16:29 AM9/29/05
to
In message ef168...@webx.raydaftYaTP, Marcus burbled:

> Hey!!
>
> I have to simulate a closed controll loop for some controlled
> systems. My colleague has already written a code in Qbasic (good old
> programming!) for the controller....but we want to simulate it in
> matlab-simulink....so is there a possibility to run the qbasic code
> in matlab ....or mybe I can run it in C++ and convert it than to a
> mfile!! How easy or difficult would it be to transform the Qbasic
> code into a matlab m-file?

Depending on the size of the qbasic code, my bet would be to transfer it
into MATLAB. I did that recently with some Visual Basic functions for
converting coordinates from OSGB to WGS84. I just copy-'n'-pasted the code
from VB to Matlab and changed the bits that matlab wasn't colouring properly
in the editor.
BASIC and MATLAB are quite similar languages in many respects - if you know
both well and the code's not too long, just convert it. It'll be easier to
maintain in the long run and you'll probably re able to tidy up the code as
you re-write it.

--
Ian Cowley
Bishop's Stortford/Cambridge, UK

www.iancowley.co.uk/contact


JohnCre...@hotmail.com

unread,
Sep 29, 2005, 4:41:43 AM9/29/05
to

I think that quick basic is a fair bet different then visual basic in
that the goto statement is used much more in quick basic. If the code
looks like spaghetti code then conversion could be a problem.

Marcus steindi

unread,
Sep 29, 2005, 5:08:28 AM9/29/05
to

Thanks for your reply...
in that code isn't any goto statement..it contains out of several for
and if loops and definition stuff (declare arrays and
variables)....it's a programm to find the best parameters
(Proportional,Integration,Derivation) for a given closed control loop
by calculating the minimal errorsum (Setpoint-Processvalue).

0 new messages