title: Custom Matlab/Octave runtime for AWS Lambda
body: <p>I have a couple of <code>.m</code> function files on an EC2 instance (with Octave) and I run them from a Node.js Lambda function. I was reading up on <a href="https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html" rel="nofollow noreferrer">Custom AWS Lambda runtimes</a> and realized that it might make my job a lot easier if I could directly run my <code>.m</code> files on a Lambda function but this is new to me and I am unable to figure out how to make a custom Matlab runtime.</p>
  <p>I've looked at other online sources for custom AWWS Lambda runtimes but I have the same problem where I am not sure how to convert those steps for Matlab. I've also seen a few cases of building a standalone <code>.exe</code> and uploading a zip file with that to Lambda and running that from the Lambda function. I am not sure if that will be a good solution for me since I'll need to provide the input arguments for the function I run. <a href="https://stackoverflow.com/questions/43214967/can-the-matlab-runtime-execute-on-aws-lambda">This</a> seems doable but again relies on EC2.</p>
  <p>Is there a way to create a Lambda function with a custom Matlab or Octave runtime?</p>
  <p>Any pointers for this would be helpful.</p>
  <p>Edit: I tried to follow the accepted answer <a href="https://www.mathworks.com/matlabcentral/answers/348226-how-to-convert-m-from-windows-to-linux-executable-file" rel="nofollow noreferrer">here</a> but I am unable to install the MATLAB runtime on my instance since there's not enough space.</p>