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
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
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.
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).