Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start an application(Matlab) from VB

Status
Not open for further replies.

tomaa

Instructor
Jan 22, 2003
3
CH
I have a matrix in Visual Basic and I would like to copy it into Matlab. How could I do this?


Thank you for your help
 
Hi,

Output the matrix to a comma separated file and let matlab read the file. You can generate the .m file dynamically from vb to get more flexiblity if necessary. You can also call matlab from vb and return to vb after the matlab job is done using the WaitForSingleObject API (e.g. for cleaning up files).
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Yes this is the method thank you, could you help me out with some code? I mean how to generate the .m file in VB do I have to make a .dll file? And how does this calling from matlab and returning the result go?

That would be very helpful

tomaa
 
Hi again,

I don't have matlab so I can't test any examples for you.
Use the open and print statements in VB to make a new .m file.
Call matlab with the file as parameter. See faq222-428 on how to make VB wait until the process is finished.
You'll have to make the .m file so that the output is saved to a file and then read the file from VB if you want to retrun a result.

Why do you use VB? Can't you just use matlab or C++, which integrates much better with Matlab?


Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top