MATLAB Function Reference |
Syntax
data = ddereq(channel,'item
') data = ddereq(channel,'item
',format) data = ddereq(channel,'item
',format,timeout)
Description
ddereq
requests data from a server application via an established DDE conversation. ddereq
returns a matrix containing the requested data or an empty matrix if the function is unsuccessful.
If you omit optional arguments that are not at the end of the argument list, you must substitute the empty matrix for the missing argument(s).
If successful, ddereq
returns a matrix containing the requested data in variable, data
. Otherwise, it returns an empty matrix.
Arguments
Examples
Assume that we have an Excel spreadsheet stocks.xls
. This spreadsheet contains the prices of three stocks in row 3 (columns 1 through 3) and the number of shares of these stocks in rows 6 through 8 (column 2). Initiate conversation with Excel with the command:
channel = ddeinit('excel','stocks.xls')
DDE functions require the r
x
c
y
reference style for Excel worksheets. In Excel terminology the prices are in r3c1:r3c3
and the shares in r6c2:r8c2
.
To request the prices from Excel:
prices = ddereq(channel,'r3c1:r3c3') prices = 42.50 15.00 78.88
To request the number of shares of each stock:
shares = ddereq(channel, 'r6c2:r8c2') shares = 100.00 500.00 300.00
See Also
ddeadv
, ddeexec
, ddeinit
, ddepoke
, ddeterm
, ddeunadv
ddepoke | ddeterm |