简体   繁体   中英

Call MATLAB from Google Colab

Is it possible to used MATLAB commands from Google Colab (Jupiter on cloud)?

For example, I would like to call Risk Management Toolbox functions like bin(vbt, Name, Value), tbfi(vbt, Name, Value) or tuff(vbt, Name, Value) in Google Colab.

I tried without success

import matlab.engine
eng = matlab.engine.start_matlab()

Nope. Google Colab runs its Python code on Google's server-side Python environment. I don't think Google has bought Matlab for everybody.

It is possible through octave or matlab libraries. Though I found it difficult to use for custom functions in MATLAB which were using other MATLAB functions. Here are the links to a few materials that helped me to use MATLAB in Google colab:

https://www.scivision.dev/run-matlab-code-from-python-oct2py/#:~:text=Python%20can%20run%20Matlab%20code%20using%20GNU%20Octave,used%20to%20transfer%20data%20between%20Octave%20and%20Python .

https://github.com/blink1073/oct2py

Unable to import matlab.engine in python

Yes. To activate this option use:

!apt install octave

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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