Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
converting c++ to matlab -tips

Subject: converting c++ to matlab -tips

From: Aidy

Date: 7 Feb, 2011 10:13:03

Message: 1 of 6

Hello guys,

Well, I have some C++ code which I need to convert into the Matlab environment. I've been using Matlab for 1 year now. It was my first programming environment. I have zero experience with C++ /Visual Studio 2010 (which is the IDE I have).

Is there any advice you guys can share with me as I embark on this task ( technical or non-technical)?

I am tending to believe this will be a lot of stress.................

your advice is welcome,

cheers
aiden

Subject: converting c++ to matlab -tips

From: Wayne King

Date: 7 Feb, 2011 10:20:06

Message: 2 of 6

"Aidy" wrote in message <iiogjf$b97$1@fred.mathworks.com>...
> Hello guys,
>
> Well, I have some C++ code which I need to convert into the Matlab environment. I've been using Matlab for 1 year now. It was my first programming environment. I have zero experience with C++ /Visual Studio 2010 (which is the IDE I have).
>
> Is there any advice you guys can share with me as I embark on this task ( technical or non-technical)?
>
> I am tending to believe this will be a lot of stress.................
>
> your advice is welcome,
>
> cheers
> aiden

Hi Aiden, do you plan on rewriting your C++ code, or creating MEX files? Wasn't sure what you mean when you said "convert" to the MATLAB environment.


Wayne

Subject: converting c++ to matlab -tips

From: Aidy

Date: 7 Feb, 2011 10:52:03

Message: 3 of 6


Hey Wayne,

I'm planning on rewriting the C++ code that I have into Matlab code. The C++ code has about 2 header files, 2 .cpp files. Never worked with C++ code of any type before. I did a few C++ online tutorial stuff a while back but nothing in detail enough for me to remember any of it..........so that's my position basically...


your advice is welcome

all the best,
aiden

Subject: converting c++ to matlab -tips

From: Aidy

Date: 8 Feb, 2011 22:32:03

Message: 4 of 6

hmmm.... no replies really....must be a loss cause I'm dealing with

oh well.....I'll try..........at least it's something

Subject: converting c++ to matlab -tips

From: Wayne King

Date: 9 Feb, 2011 01:41:04

Message: 5 of 6

"Aidy" wrote in message <iisg93$lki$1@fred.mathworks.com>...
> hmmm.... no replies really....must be a loss cause I'm dealing with
>
> oh well.....I'll try..........at least it's something

Hi Aidy, I think it's pretty much just trying to boil the C/C++ code down to pseudo code and then trying to rewrite it MATLAB. Sounds like you're much more familar with the MATLAB language than C/C++, so maybe you can extract the gist of the C code?

Alternatively, you can look into using the C/C++ code as the basis for creating a MEX file where you just call the algorithm in MATLAB.

Sorry I can't offer anything more concrete.

Wayne

Subject: converting c++ to matlab -tips

From: Aidy

Date: 9 Feb, 2011 03:05:05

Message: 6 of 6

Wayne,

Yes, I think I'll try to interpret the C-code and rewrite it ........ mex file would be possible but I also need to understand theoretical aspects of the underlying algorithm, I think recoding in Matlab would also help with this as well.....

thanks for the advice
--aiden

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us