×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    31

    porting matlab to c++

    hi....

    can i port from matlab to c++??

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: porting matlab to c++

    Feel free to stick with your original thread (http://discussion.forum.nokia.com/fo...d.php?t=117731).

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    31

    Re: porting matlab to c++

    hi...


    but this is about a different subject!! matlab to symbian Vs matlab to c++!!!

  4. #4
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Malmö, Sweden
    Posts
    157

    Re: porting matlab to c++

    As an answer to your question both in this thread, and in the second:

    You don't "port" between matlab, and Symbian C++ or any other C++.
    You "rewrite".

    If you don't know the difference, I think you should try some less advanced project...

    matlab is for prototyping, when you want to do it for real, you have to get your hands messy with code, and you have to know how to efficiently optimize your code for that platform...

  5. #5
    Registered User
    Join Date
    Sep 2007
    Posts
    31

    Re: porting matlab to c++

    "I think you should try some less advanced project..."

    ?????

    I think you should try to be more respectful sweetie

  6. #6
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: porting matlab to c++

    I don't think olhed is being unrespectful, but you should certainly explain a bit better what you're trying to achieve. May I assume your intention is to port an environment (such as GNU Octave), or as olhed said just rewrite some code in C++?

  7. #7
    Registered User
    Join Date
    Sep 2007
    Posts
    31

    Re: porting matlab to c++

    So how do u interpert the word:u should try less advanced project? what is he/she trying 2 acheive by stating this sentence?!!

    And what I meant is converting Matlab code to C code

  8. #8
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Malmö, Sweden
    Posts
    157

    Re: porting matlab to c++

    I didn't mean to sound that condescending.

    Its just that you seem quite confused on what you want to do.

    matlab isn't really a programming language, its a math tool with scripting support that makes it very suitable for prototyping.

    Since it is in its nature so different from a programming language such as C or C++, its hard to talk about "porting".

    There exists libraries that can run some or most of mathlab "code", such as the GNU Octave meantioned above, maybe this is what you really are looking for?

    Octave is a "mathlab engine" if you want, that can run your mathlab code and is possible to integrate into your C/C++ project, so you don't have to change the mathlab code.

    But, if you want pure C/C++ code that performs the same functions as your mathlab code did, you will have to rewrite it from scratch, since it is so different.

    And how to do that? well, you just need to know what your mathlab stuff do, and do the same stuff with C/C++ concepts instead... (which could be quite a lot of work if your mathlab code makes complex computations for which there is no standard support for in C/C++)

    Edit:
    But I see in your other thread, that you have found a "Mathlab compiler" that compiles M-Code into C/C++, sounds like a great start
    You'd have to evaluate how big and memory hungry code it generates though, and if it is suitable to run on a constrained device such as a cellphone.

    Also note that, though it is true that the algorithm is the most important for speed, its also _very_ important with a good implementation suited for the platform.
    Specially on constrained devices were memory is low and slow, and processing power very limited (compared to the desktop).

    This means, that even though your mathlab complier might produce working code, you might be able to increase the speed 10, or even 100-fold, by implementing the algorithm from scratch.
    Last edited by olhed; 2008-01-07 at 15:41.

  9. #9
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    57

    Exclamation Re: porting matlab to c++

    Dear friends
    I am vary interesting to porting the matlab application to Symbian
    And I have an idea if you can help me?
    In like show you How TO: Create standalone executable for matlab file.
    http://www.onecore.net/howtocreate-s...atlab-file.htm
    You will see that in
    Code:
    mbuild –setup
    where the MatLab setup the C++ compiler. If we can make the matlab see the gcc compiler which use in the Symbian. I think we can port the matlab to symbian.

    we’ll write simple program that uses plot function to draw the 2-d graph of two varibales.

    Code:
    function graph
    a=[12,54,33,80,26];
    b=[44,25,72,98,66];
    plot(a,b);
    After writing the code,save the file with filename “graph.m”.

    In the example which shows in the link you can see that command
    Code:
    mcc -m graph.m -o graph
    will generate the executable file plus the course code.

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: porting matlab to c++

    Although I have no intent to check that, my guess would be that MathWorks does not give away their developed-trimmed-optimized-etc. precious code, so that executable and its source heavily use those two .dll-s (mwcomutil and mwcommgr), which are obviously not available in Symbian environment.
    Check www.octave.org if it helps.

Similar Threads

  1. Porting from Matlab to Symbian...
    By jshunnar in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2007-10-29, 15:04
  2. S60 S80 Porting tools
    By dgaur in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-05-04, 07:54
  3. FOC product for porting of S60 app.UI to UIQ
    By chomed in forum Symbian User Interface
    Replies: 2
    Last Post: 2005-01-28, 22:49
  4. FOC product for porting of S60 apps to UIQ
    By chomed in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2005-01-19, 10:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×