0

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()
4jano20
  • 25
  • 1
  • 5

2 Answers2

0

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

Some Matlab code can be run under GNU Octave, a FLOSS clone of Matlab. That can be installed in your Google Colab session's environment by calling !apt install octave in a notebook cell.

Andrew Janke
  • 23,508
  • 5
  • 56
  • 85
  • This answer isn't up to date – Sharonas Ykm Aug 26 '22 at 09:04
  • @SharonasYkm Interesting. Can you provide any links to doco on what has changed? I can't find anything by googling. Ordinarily I'd just delete this answer, because I don't care to spend time on a conversation like this on a minor answer, but it has been Accepted, so Stack Overflow won't let me delete it. – Andrew Janke Aug 28 '22 at 12:59
  • https://stackoverflow.com/questions/56416657/how-to-run-matlab-m-files-in-google-colab – Sharonas Ykm Aug 28 '22 at 15:16
  • 1
    That answer doesn't look like it makes this one wrong. That is using GNU Octave, not Matlab. Octave is a FLOSS clone of Matlab. And that looks like it is doing the installation on the server side. Might be worth mentioning, though. – Andrew Janke Aug 30 '22 at 04:43
0

Yes. To activate this option use:

!apt install octave
Sharonas Ykm
  • 427
  • 2
  • 4
  • 13