File Exchange

image thumbnail

Run Processing sketches in Matlab

version 1.0.0.0 (201 KB) by Mark
Run Processing Sketches in Matlab (or Max/MSP)

1 Download

Updated 15 Jun 2011

View License

Run processing sketches from Matlab or MAX/MSP.

The Processing class wraps a sketch (PApplet) in a window (Frame) and provides methods to show and dispose sketches.

First, you need to make sure Matlab has acces to the processing code in "core.jar". I have included an install script to add "core.jar" to the classpath.

Then, export the sketch (*.pde) to an Applet to obtain the *.java and *.class files. Make sure there are in Matlab's classpath (using javaclasspath).

Finally, you can run the sketch by using
Processing.run('your.sketch.classname.here')

You can also set sketch location, always on top, and a few other things.

An example sketch & matlab script is included.

This Processing-wrapper-class can also be used in MaxMSP.

Cite As

Mark (2020). Run Processing sketches in Matlab (https://www.mathworks.com/matlabcentral/fileexchange/31817-run-processing-sketches-in-matlab), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Mahmood Sabooni

Hi,
I need to run a processing program through MATLAB. I have found your code very udeful but when I run it according to your manual, I see the following error which seems happen after this lien:
Processing.run('nl.madebymark.Processing.HelloWorld');
This is the error:
Java exception occurred:
Java exception occurred:
java.lang.NoClassDefFoundError: com/cycling74/max/MaxObject

at java.lang.Class.getDeclaredMethods0(Native Method)....
May I ask you, what is your suggestion?

best,

Mahmood,

Ahmed Eissa

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux