Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

realtime

RavenPack News Analytics real-time data

Syntax

[status,lhandle] = realtime(c,symbol,listener)

Description

example

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

Examples

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:

  • ENTITY_NAME

  • CATEGORY

  • SUB_TYPE

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)';
fields = {'ENTITY_NAME','CATEGORY','SUB_TYPE'};

[status,lhandle] = realtime(c,symbol,...
                            @(~,evt)rpExampleListener(evt,fields))
status =

     1

lhandle =
 
	handle.listener

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.

openvar('NewsEvent')

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.

delete(lhandle)

Close the RavenPack News Analytics connection.

close(c)

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.

Tips

  • 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

Was this topic helpful?