I did it the other way 'round, that is sending data from matlab to processing for plotting. Did it by starting the processing applet from within matlab and feeding the matlab data into processing by a function call...
I'll just post it, hope it helps solving your problem.
THE MATLAB part:
Code:
function process()
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import processing.core.*;
import plotMatlab.*;
% create window in which applet will execute
applicationWindow = JFrame( 'An appl
et running as an application' );
width = 800;
height = 600;
% create one applet instance
appletObject = plotMatlab;
% call applet's init and start methods
appletObject.init;
appletObject.start;
% attach applet to center of window
applicationWindow.getContentPane.add( appletObject );
% set the window's size
applicationWindow.setSize( width, height );
% showing the window causes all GUI components
% attached to the window to be painted
applicationWindow.show;
setData(appletObject, 400+randn(10000,1)*80, 300+randn(10000,1)*60, rand(10000,1)*220, ones(10000,1)*80);
THE PROCESSING PART (plotMatlab.pde):
Quote:float[] dataX, dataY, dataZ, dataCol, dataAlpha;
void setup(){
size(800,600,P3D);
background(255);
println("P5: init");
}
void draw(){
if (dataX!=null){
plotData();
}
}
void setData(float[] dataX, float[] dataY, float[] dataCol, float[] dataAlpha){
this.dataX = dataX;
this.dataY = dataY;
this.dataCol = dataCol;
this.dataAlpha = dataAlpha;
println("P5: data set");
}
void plotData(){
background(255);
colorMode(HSB);
for (int i=0; i<dataX.length;i++){
stroke(dataCol[i],220,220, dataAlpha[i]);
point(dataX[i], dataY[i]);
}
}
Think it's pretty straightforward.
To make matlab actually see your applet and the processing core.jar you have to add them via javaclasspath, but you might have figured that out by yourself through a search in matlab's excellent doc...
Regards,
postpop.