Embedding the Java Interface in MATLAB

I am trying to write a MATLAB GUI that uses the XBee-API to talk to the XBee wireless radio on board the Arduino. The GUI mainly collects data and analyzes incoming packets.

I want to do addPacketListeneras defined in the Developer's Guide (see the section "Receiving packets") in order to wait for packet processing. In Java, this will be done like this:

xbee.addPacketListener(new PacketListener() {
    public void processResponse(XBeeResponse response) {
        // handle the response
    }
});

In MATLAB, I would make addlistener()and set my callback to do my processing.

I don’t know much about Java, so I was wondering if the code processResponsea la MATLAB can be customized : can I do something like the following:

function processResponse
    #% do response here
end 

>> xbee.addPacketListener(@processResponse)

, ; , , XBee ( Java addPacketListener).

+5
2

, , , XBee PacketListener.processResponse(XBeeResponse x) MATLAB XBeeResponse. MATLAB, Java- MATLAB, Java? , , , .

, , , , MATLAB Java-, . , , PacketListener Java, , matlabcontrol, Java PacketListener MATLAB.

, GUI, Java, , MATLAB, matlabcontrol. MATLAB Java, , undocumentedmatlab.com.

, , - Java. Java, MatLab , MatLab "" Java. , Java MatLab "f1" "f2". Java, f1 f2. MatLab , , , .

, , , Java- processResponse(XBeeResponse x), , MatLab, MatLab - . , PacketListener XBeeResponse, XBee MatLab . .

+3

MATLAB Java Java MATLAB.

Java-jars- javaclass, , ..

-1

All Articles