I have heard of Matlab quiet a lot and i wanted to know how is it helpful in context to C++ ? isn't it used by engineers to design circuit ? can anyone please clear things out for me :) ?
Matlab and C++
Started by ahmed, Aug 01 2009 08:24 AM
6 replies to this topic
#1
Posted 01 August 2009 - 08:24 AM
|
|
|
#2
Posted 01 August 2009 - 08:27 AM
MATLAB - Wikipedia, the free encyclopedia
That might help?
*EDIT*
Well I read around a little and I would guess that Matlab would provide a much more powerfull and bigger Math library for C++ where C++ still uses the old C Math.
That might help?
*EDIT*
Well I read around a little and I would guess that Matlab would provide a much more powerfull and bigger Math library for C++ where C++ still uses the old C Math.
#3
Posted 01 August 2009 - 01:55 PM
Matlab is basically a number cruncher. It does that very well, but it is not a replacement for a programming language. If you have lots of integerals, Matlab rocks (engineers). If you're a programmer, you use C++ (or another programming language).
#4
Posted 02 August 2009 - 11:42 AM
I used Matlab with C for my final year project ten years ago to analyse neural net performance that I'd written.
There should be the option in Matlab to generate C code from the Matlab code that you've written. Does Matlab no longer have that option?
Matlab can be used for any mathematical analysis task that comes to mind.
There should be the option in Matlab to generate C code from the Matlab code that you've written. Does Matlab no longer have that option?
Matlab can be used for any mathematical analysis task that comes to mind.
#5
Posted 04 March 2010 - 02:24 AM
ahmed said:
I have heard of Matlab quiet a lot and i wanted to know how is it helpful in context to C++ ? isn't it used by engineers to design circuit ? can anyone please clear things out for me :) ?
MATLAB is a programming language which is geared toward mathematics. Syntactically, it reminds me of C or Pascal, but it has a number of special features, such as vectorized code which are specific to heavy math use. Here is an example: In most procedural languages, if one wished to add 2.5 to every element of 2-dimensional array A, then two loops would run over the array something like this:
for i = 1:10
for j = 1:20
A(i,j) = A(i,j) + 2.5;
next
next
In MATLAB, code may be vectorized, like this:
A = A + 2.5;
Generally, there is a lot less looping in MATLAB than in, say, C or Pascal. I use MATLAB often in my work (data mining) and I am always amazed at how much longer and less readable code in C/C++ is for the same types of operations. Naturally, matrix multiplication is included ("MATLAB" is short for "matrix laboratory). The following code can calculate the entire forward pass for an MLP neural network:
HiddenLayer = tanh(InputLayer * HiddenWeights);
OutputLayer = tanh(HiddenLayer * OutputWeights);
Note that HiddenLayer and OutputLayer are matrices: this code does not calculate the forward pass for one example, it does so for all of them.
Also, there are many built-in functions for math and other things (file handling, etc.). The math functions tend to be well-written and highly optimized, and the other functions are nice because if I want to load an image in my program, is use imread, and every MATLAB programmer can use the code, regardless of platform- there is no need for adding on libraries, etc.
If you're interested in MATLAB, I suggest taking a look at my Web log, Data Mining in MATLAB.
#6
Posted 04 March 2010 - 02:26 AM
Mathematix said:
There should be the option in Matlab to generate C code from the Matlab code that you've written. Does Matlab no longer have that option?
There is a MATLAB Compiler product which allows deployment as standalone executable, but the base MATLAB product will not do this.
#7
Posted 08 June 2010 - 10:11 PM
which software is suitable for interface integration?


Sign In
Create Account


Back to top









