RavenPack News Analytics real-time data



[status,lhandle] = realtime(c,symbol,listener) retrieves RavenPack® News Analytics real-time data using the RavenPack News Analytics connection c.


collapse all

Create a RavenPack News Analytics connection c using the user name username and password pwd.

c = ravenpack('username','pwd');

Retrieve RavenPack News Analytics real-time data using RavenPack News Analytics connection c. Here, the symbol is set to the entitled symbol (entity-scores :rpna-4.0-eqt). Use the existing event listener rpExampleListener. Specify these fields as inputs to rpExampleListener:




You can modify rpExampleListener or create your own event listener to add other functionality.

The MATLAB® variable evt is an instance of a news event. Do not instantiate this variable. Assign this variable any name.

symbol = '(entity-scores :rpna-4.0-eqt)';

[status,lhandle] = realtime(c,symbol,...
status =


lhandle =

status returns a 1 to signify a successful RavenPack News Analytics connection.

lhandle returns the contents of the handle to the RavenPack listener object.

The existing event listener rpExampleListener populates the MATLAB variable NewsEvent with the real-time data.

Display the real-time data.


MATLAB displays the Variables editor to show the news event data.

To stop real-time data updates, use the MATLAB delete function to delete the handle to the RavenPack listener object.


Close the RavenPack News Analytics connection.


Input Arguments

collapse all

RavenPack News Analytics connection, specified as a connection object created using ravenpack.

RavenPack entitled symbol list, specified as a character vector, string scalar, cell array of character vectors, or string array.

Data Types: char | cell | string

Listener event handler, specified as a function handle to listen for RavenPack News Analytics data events. You can modify the existing listener function rpExampleListener or create your own to add other functionality. You can find the code for the existing listener function in the rpExampleListener.m file.

Data Types: function_handle

Output Arguments

collapse all

Subscription status, returned as a logical true or false. true or 1 signifies a successful subscription to real-time RavenPack News Analytics data. false or 0 signifies an unsuccessful subscription to the real-time data or a subscription that is currently running.

RavenPack News Analytics Gateway event listener, returned as a handle to the RavenPack listener object.


  • Before creating a RavenPack News Analytics connection:

    • Start the RavenPack Data Gateway process.

    • Add the full path of the Data Gateway Client JAR file to the static or dynamic Java® class path.

    For details, see ravenpack.

Introduced in R2015b