MATLAB Conversion Help (to c or c++)

  • Context: MATLAB 
  • Thread starter Thread starter starfighter
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary

Discussion Overview

The discussion revolves around the challenges of converting a MATLAB application into C or C++ for use in a mobile platform, specifically targeting iPhone development. Participants explore the feasibility of compiling MATLAB code and integrating it with development environments like Visual Studio and X-Code, as well as the potential for creating a mobile application.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks to convert MATLAB code to C/C++ for integration into Visual Studio and the development of a GUI, expressing uncertainty about the process.
  • Another participant questions whether the goal is to port MATLAB code or to make it callable from C/C++, highlighting the limitations of Visual Studio on macOS.
  • There is a suggestion that MATLAB can compile code into shared libraries that can be called from other programming languages, though this process is described as complex and potentially challenging for inexperienced programmers.
  • A participant outlines their specific application, which utilizes MATLAB's imaging and financial toolboxes, and expresses a desire to port it to mobile platforms, particularly iPhone, for proof of concept.
  • Questions are raised about the technical feasibility of calling MATLAB compiled objects on iPhone, using X-Code, and whether a web app might be a simpler alternative.
  • The participant indicates a lack of technical knowledge and seeks to understand the steps involved in compiling MATLAB code for use in mobile development.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and uncertainty regarding the conversion process and the technical requirements involved. There is no consensus on the best approach or the feasibility of the proposed solutions.

Contextual Notes

Limitations include the complexity of compiling MATLAB code into a format usable by mobile platforms, the potential need for experience with threading when managing shared libraries, and the lack of clarity on the exact requirements for integration with X-Code.

Who May Find This Useful

This discussion may be useful for developers looking to transition MATLAB applications to C/C++ for mobile platforms, particularly those interested in iPhone development and the integration of MATLAB code with other programming environments.

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 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
7K