MATLAB Answers

Call MATLAB from Google Colab

180 views (last 30 days)
Alejandro Cermeño
Alejandro Cermeño on 29 Aug 2021
Answered: Yongjian Feng on 31 Aug 2021
Hello there, 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()

Answers (2)

Yongjian Feng
Yongjian Feng on 29 Aug 2021
This is the same as calling matlab from python, right? Can you call it from python first?
  1 Comment
Alejandro Cermeño
Alejandro Cermeño on 30 Aug 2021
Yes, calling MATLAB from python is done with
import matlab.engine
eng = matlab.engine.start_matlab ()
however, this method implies that MATLAB is installed on the PC and Google Colab is a cloud environment.
Is it possible to call MATLAB from Google Colaboratory?

Sign in to comment.


Yongjian Feng
Yongjian Feng on 31 Aug 2021
Seems like you need to bridge it.
Your local PC and Google Colab shall be able to communicate using python, I imagine. Using HTTP server for example. Then using python in your local PC to call matlab. Then python in your local PC to communicate with Google Colab.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!