Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run matlab .m files in google colab

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

like image 604
0101 Avatar asked Jun 02 '19 15:06

0101


1 Answers

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.

like image 61
korakot Avatar answered Oct 05 '22 23:10

korakot