User:Markuman: Difference between revisions

Jump to navigation Jump to search
871 bytes added ,  22 June 2014
no edit summary
No edit summary
No edit summary
 
Line 107: Line 107:
       0.602763376071644
       0.602763376071644


Default Matlab seed is rand('twister',twister_seed(5489))




==== TODO ====
==== TODO ====


* Find the `seed` stuff in octave source
* https://savannah.gnu.org/bugs/?42557
 
=== compiling .mex files written by octave for matlab ===
 
Example file
 
    #include "mex.h"
   
    void
    mexFunction (int nlhs, mxArray *plhs[],
                int nrhs, const mxArray *prhs[])
    {
      mexPrintf ("Hello, World!\n");
   
      mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs);
    }
 
Note: Octave need the file extension .mex.  Matlab needs on Linux .mexa64 and on Windows .mexw64 etc.
 
==== using gcc or tcc on the same plattform ====
 
 
Using tcc or gcc
 
    tcc -I/usr/include/octave-3.8.1/octave/ -lm -shared mexample.c -o mexample.mex
    gcc -I/usr/include/octave-3.8.1/octave/ -lm -shared -fPIC mexample.c -o mexample.mex
 
    cp mexample.mex mexample.mexa64
 
This function can now be used on Linux x64 plattform from both, octave and matlab.
 
* TODO: crosscompiling
32

edits

Navigation menu