Executing Matlab function from Processing

I’m trying to find a way to execute a Matlab function from a Processing script.

I have a local installation of Matlab, and I know it should be possible to execute a Matlab function from Java, using Matlab’s engine:

However, when I’m trying something similar from within a Processing sketch, I get the following error:

Any ideas?

Thanks in advance,

Were you able to get this to work?

It sounds like you are missing requirements that need to be installed for the Java API to work – but if that isn’t it, can you execute Matlab scripts from the command line? If so, perhaps you could use exec().

Another possibility is, if you need math processing and Processing rendering combined but don’t need MatLab or Java code specifically, you could use the Processing.R mode, which gives you the R language and the Processing Java API.

1 Like