7

I am currently trying to run this repo https://github.com/Fanziapril/mvfnet which requires a step:

"Run the Matlab/ModelGeneration/ModelGenerate.m to generate the shape
model "Model_Shape.mat" and copy it to the Matlab/"

Is it possible to run a .m file in colab to do this?

Also, I have looked into oct2py library https://blink1073.github.io/oct2py/, but was not able to successfully run the file. I followed this How to run a MATLAB code on Python

1
  • I think Google Colab can only run iPython notebooks and some bash commands through the iPython notebook, so you could try to run the .m file by uploading it to Colab and using !matlab file.m (basically replace matlab with maybe octave or some other MATLAB compiler which can be installed in Colab, and you use exclamation mark before the command to indicate it is to be run like a bash command). Commented Jun 3, 2019 at 5:11

1 Answer 1

9

You need to first install octave with

!apt install octave

Then you can run your m-file with

!octave -W file.m

Here's a minimal example.

Sign up to request clarification or add additional context in comments.

1 Comment

after getting the mat file generated, I get raise ValueError('Unknown mat file type, version %s, %s' % ret) ValueError: Unknown mat file type, version 57, 54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.