简体   繁体   English

如何在colab中加载matlab文件?

[英]How to load matlab file in colab?

I want to load a MATLAB file into COLAB using我想使用以下命令将MATLAB文件加载到COLAB

scipy.io.loadmat('../Data/burgers_shock.mat')

I don't know how to set the path for .mat file and where to keep the .mat file.我不知道如何设置.mat文件的路径以及保存.mat文件的位置。

  1. upload your .mat file on your drive.将您的 .mat 文件上传到您的驱动器上。
  2. add these lines at the top of your code from google.colab import drive drive.mount('/content/drive')在您的代码顶部添加这些行 from google.colab import drive drive.mount('/content/drive')
  3. then just load using the following path S=scipy.io.loadmat('/content/drive/My Drive/burgers_shock.mat');然后使用以下路径加载 S=scipy.io.loadmat('/content/drive/My Drive/burgers_shock.mat');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM