can i port from matlab to c++??
can i port from matlab to c++??
Feel free to stick with your original thread (http://discussion.forum.nokia.com/fo...d.php?t=117731).
but this is about a different subject!! matlab to symbian Vs 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++.
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...
"I think you should try some less advanced project..."
I think you should try to be more respectful sweetie
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++?
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
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++)
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.
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.
You will see that inwhere 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.Code:mbuild –setup
we’ll write simple program that uses plot function to draw the 2-d graph of two varibales.
After writing the code,save the file with filename “graph.m”.Code:function graph a=[12,54,33,80,26]; b=[44,25,72,98,66]; plot(a,b);
In the example which shows in the link you can see that commandwill generate the executable file plus the course code.Code:mcc -m graph.m -o graph
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.