MATLAB MATLAB Conversion Help (to c or c++)

  • Thread starter Thread starter starfighter
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
The discussion revolves around converting a MATLAB application into C or C++ for integration into Visual Studio and potentially X-Code on a Mac. The user seeks guidance on whether it's possible to compile MATLAB code into a format usable in these environments, particularly for mobile platforms like iPhone. It is noted that MATLAB can compile code into shared libraries, which can then be called from other programming languages, but this process can be complex and may require experience with threading. Additionally, while X-Code supports various programming languages, using MATLAB compiled objects on iPhone is feasible but not straightforward. The user expresses a need for clarity on the technical requirements and options available for this conversion process.
starfighter
Messages
2
Reaction score
0
Hi

I have made an application in MATLAB, well the technical part with the use of the tool-kits built in.

Now i need to get that information from MATLAB in the form of c or c++ so i can import it into visualstudio and made a GUI and add features such as database and demo/reg models.

Thing is, i have no idea how or if its even possible?

All i can see is that it can be made into a format so it can be called as a com object.

I am looking at going over to MAC, any ideas if i can compile this so i can be run via X-Code which i am led to think is Objective-C?

Thanks for any help. If you think another forum might be better too, please tell me and i will move it, or repost it...
 
Physics news on Phys.org
I'm so horribly confused. Do you need to port (translate) your existing MATLAB code to C/C++ or make your MATLAB code callable from C/C++?

You can't run stuff compiled in visual studio on a mac 'cause vs uses native windows stuff when compiling, but you can totally run C/C++ on mac.
 
starfighter said:
Hi

I have made an application in MATLAB, well the technical part with the use of the tool-kits built in.

Now i need to get that information from MATLAB in the form of c or c++ so i can import it into visualstudio and made a GUI and add features such as database and demo/reg models.



I'm afraid I don't have much of an idea what you're talking about either. Firstly, Matlab has its own GUI creation tools that you can use to set up GUIs to control your code; you can then generate standalone executables using Matlab that bundle your application code and the GUI code for deployment to users who don't have Matlab installed.

What I think you're really after is the following. Matlab allows you to compile Matlab code to shared libraries that you can then call from other code. It's perfectly conceivable that you could write, say, Matlab code to implement an optimization library, compile it to a shared library using the Matlab compiler, and then call this library from code written in Visual Studio. However, although the latest versions of Matlab make this much easier than it was in the past, it's far from trivial, and the fact that your question is so vague makes me suspect that you might find it challenging.

See the Matlab Compiler docs for much more information on this, including examples. There are loads of relevant docs on this precise topic in the Matlab help system.

starfighter said:
I am looking at going over to MAC, any ideas if i can compile this so i can be run via X-Code which i am led to think is Objective-C?

XCode is a development environment on OS X which allows you to write code in Java, C/C++, Objective C, Python, Ruby, and so on. It's a decent tool for creating software on the Mac but it's nothing in comparison to Visual Studio. Calling Matlab shared libraries on a Mac is possible but you'll need to have experience with using threads to create and manage access to the library safely. Again, this is far from being trivial and isn't something an inexperienced programmer could do without difficulty.
 
Sorry, i am a master of been vauge, i am really not as uneducated as i may sound.

- What I Have

I have an application i have made in MatLab. I can't say what it is without making you sign an NDA, and even then I doubt i could get approval, so will have to just call it an "application".

Its using the imaging, and financail toolbox within MatLab, and it all runs like i want it to, so the MatLab side is fine.

- What I Want

I want to put my MatLab application on a mobile platform. We are using Blackberry, IPhone and Windows Mobile.

I need to port it to "one" for proof of concept, but it would be good if that "one" was the IPhone as its got 70% usuage in my company, followed by blackberry, and just a few with the Windows Mobile Platform.

I have took on more than I am experienced with, I am good at MatLab Code, and good at C, but that's about it.

So what I will do is work in a project management roll and get an outside contractor to do the code.

- Problem

I don't have a clue on the technical side, and i want to understand how one can use MatLab code, say on the Iphone.

I would like to understand what's involved, for example compile MatLab to ? and then use X-Code to program the application.

I understand i have to join apple dev to get the sdk and way to distribute, which is one thing.

So is it

A) Possible to call a MATLAB compiled object on iphone?

B) Using X-Code?

C) Is there a better way (web app)?

D) Is it a simple case of compiling MatLab code, and then calling it from X-Code?


Once i get a feel of what involved, i can get some quotes from coders, if any are here, i would be glad to talk business, but i realize this is not a freelance website and don't want to violate any rules here.
 

Similar threads

Replies
5
Views
3K
Replies
3
Views
2K
Replies
1
Views
1K
Replies
4
Views
3K
Replies
6
Views
4K
Replies
12
Views
3K
Replies
1
Views
2K
Replies
7
Views
6K
Back
Top