Thursday, July 30, 2009

How to integrate Visual Basic with Matlab?

i want to get the data of the image using matlab and integrate with Visual Basic.

How to integrate Visual Basic with Matlab?
Fascinating question. My guess is that you can't, but one thing to try is to first see if your Matlab installation has registered any common VB components in windows. I'm sure there's a proper way to look this up but you can actually do it using VBA that's in MS Excel (at least you can do it in Excel 2000 and XP) I haven't yet worked with .NET.





Anyway, go to MS Excel and Select Macros-%26gt; Visual Basic Editor from the Tools menu. Once the VB window opens up, in the VB window, select Tools-%26gt; References. Once there just look for anything to is labelled Matlab or looks Matlab-ian.





If you find a library go ahead and check the box next to it and hit OK. From there you should go to View-%26gt; Object broswer. When the object browser window opens you should be able to find classes from the reference you just added. Just right click on a class and hit help to get documentation for it. The documentation is usually pretty sparse so it may be difficult to piece together how things work, but if you're smart enough to work VB and Matlab you shouldn't have too much trouble.





You will be able to use these classes in your VBA module which should be pretty useful since you can use Excel spreadsheet functions after you get the data. My crowning achievement in this field is hooking a macro up to Rational Clearcase, using the macro to search for files on a network drive and then copying and adding the files to Clearcase...woohoo! Anyway this just shows that this method actually works.
Reply:your question is not clear need to tell in detail
Reply:I came here hoping someone had answered this - it's a fascinating question. Right off the bat, the only way I can see to do it is to crunch the data in Matlab, save a file in the necessary format, then chain to VB (why do you want to use VB, anyway?) to open and read the file. I'm not sure there would be any other way.

pink flowers

No comments:

Post a Comment