title: MATLAB crashes when executing a mex file
body: <p>I am trying to run a code (sent to me by someone) that uses mex files in MATLAB. I have managed to compile the mex files, but when I run the code that calls these files, I get the error shown below. I am not quite sure what's happening here, so any help will be appreciated. </p>
  
  <pre><code>Segmentation violation detected at Mon Sep 10 16:26:11 2012
  ------------------------------------------------------------------------
  
  Configuration:
    Crash Decoding  : Disabled
    Current Visual  : 0x22 (class 4, depth 24)
    Default Encoding: UTF-8
    GNU C Library   : 2.11.3 stable
    MATLAB Root     : /cae/apps/data/matlab-2012a
    MATLAB Version  : 7.14.0.739 (R2012a)
    Operating System: Linux 3.2.0-0.bpo.2-amd64 #1 SMP Fri Jun 29 20:42:29 UTC 2012 x86_64
    Processor ID    : x86 Family 6 Model 42 Stepping 7, GenuineIntel
    Virtual Machine : Java 1.6.0_26-b03 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
    Window System   : The X.Org Foundation (11006000), display localhost:10.0
  
  Fault Count: 1
  
  
  Abnormal termination:
  Segmentation violation
  </code></pre>