Monday, June 20, 2011

matlab

Matlab has a front end program called "mex" that calls a 3rd party compiler (whatever you have installed that's compatible) which will compile a C program into .mexw32, which is basically an executable file that is called in Matlab. Making a legit .mexw32 file looks pretty intense. A sample C program that takes in a number and returns 2x that number is 30 lines long and contains a lot of pretty crazy looking stuff. I spent some time studying it today and found that most of the crazy parts were sanity checks to make sure you weren't passing anything that it couldn't handle. The rest of the crazy is simply setting up Matlab-compatible data types to pass values into.

If I could find a sample program that shows how to fill up an array of data then it shouldn't be too tough to shoehorn in my file reader program such that it would read a file and dump the data into Matlab arrays. That would be pretty neat.

No comments:

Post a Comment