Make matlab-ruby work with Matlab > 7.3 and ruby 1.9 #1

merged 1 commit into from Nov 12, 2012


None yet
2 participants

morrifeldman commented Nov 12, 2012


This pull request addresses a few problems I encountered trying to use matlab-ruby

  1. It would not run in ruby because STR2CSTR is no longer available. I'm not quite sure what this means, but I got around the problem by installing a new version of swig (SWIG Version 2.0.8) and running setup.rb as follows to recreate the matlab_api_wrap.c.

    ruby setup.rb config -- --with-swig

  2. The Matlab API has changed and mxCreateDoubleMatrix has been replaced by mxCreateDoubleMatrix_730. This required a change in conversions.rb. I think some other functions are also affected and will require the _730 suffix, but I haven't tried to use anything but numeric arrays.

  3. The new mxCreateDoubleMatrix_730 requires it's size input variables to be declared as mwSize. I used a typemap in the interface file to deal with this, although I'm not sure this is the most elegant option. I tried including tmwtypes.h in the interface file, but this did not solve the problem.

After these changes, it compiles and runs. I really like this tool a lot.

Thanks and Best,

daikini added a commit that referenced this pull request Nov 12, 2012

Merge pull request #1 from morrifeldman/e7061b3099be5d551a5384cfce988…

Make matlab-ruby work with Matlab > 7.3 and ruby 1.9

@daikini daikini merged commit 17457cd into daikini:master Nov 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment