Python 2.7 如何在googlecolab中运行matlab.m文件

Python 2.7 如何在googlecolab中运行matlab.m文件,python-2.7,matlab,pytorch,google-colaboratory,torchvision,Python 2.7,Matlab,Pytorch,Google Colaboratory,Torchvision,我目前正在尝试运行此回购 这需要一个步骤: "Run the Matlab/ModelGeneration/ModelGenerate.m to generate the shape model "Model_Shape.mat" and copy it to the Matlab/" 是否可以在colab中运行.m文件来执行此操作 此外,我还调查了oct2py图书馆 , 但无法成功运行该文件。 我遵循了这一点您需要首先使用安装octave !apt install octave 然后,您可

我目前正在尝试运行此回购 这需要一个步骤:

"Run the Matlab/ModelGeneration/ModelGenerate.m to generate the shape
model "Model_Shape.mat" and copy it to the Matlab/"
是否可以在colab中运行
.m
文件来执行此操作

此外,我还调查了oct2py图书馆 , 但无法成功运行该文件。
我遵循了这一点

您需要首先使用安装octave

!apt install octave
然后,您可以使用

!octave -W file.m

这里有一个。

我认为Google Colab只能通过iPython笔记本运行iPython笔记本和一些bash命令,因此您可以尝试通过将.m文件上载到Colab并使用
来运行它!matlab file.m
(基本上用octave或其他可以安装在Colab中的matlab编译器替换matlab,在命令前使用感叹号表示它将像bash命令一样运行)。生成mat文件后,我得到raise VALUERROR('未知mat文件类型,版本%s,%s'%ret'))ValueError:未知的mat文件类型,版本57、54