views:

284

answers:

1

Here's what I want to do:

Take 2x101 matrix for x and y coordinates and import that data in Dev C++ in program and use it for that code.

Right now my Dev code has

double Cord[NCargo][2] = {{x0,y0},{x1,y2},{...},{x100,y100}}

You get the idea. I want my .mat file matrix read into and put into this Cord Matrix. The name of my C++ code is Challenge.cpp and name of MATLAB file is values.mat if that helps.

Any help would be absurdly appreciated. Thanks!

+1  A: 

matlab has C/C++ callable dlls that can read mat files.. see here for all options.

another (performance wise the fastest) option is creating a binary file that is simply a dump of the array in matlab using fwrite, then you can read that file straight into memory in your C++ app using fread.

stijn