From: Donn Shull on
"Paolo " <tarpanelli(a)libero.it> wrote in message <hmagaq$as4$1(a)fred.mathworks.com>...
> Hello,
> I am interested to know if there is any functionality in matlab to retrieve from excel data in real time. For example:
> I have an excel file where in a given cell (e.g. A1, sheet "TEST"), the data are updated in real-time (e.g. each second).
> How can I capture this data directly in Matlab to be processed?
> Thank you

If you are familiar with actxserver and your data change triggers an event then yes. For example

>> excel = actxserver('Excel.Application');
>> sheet = excel.ActiveSheet;
>> sheet.events
SelectionChange = void SelectionChange(handle Target)
BeforeDoubleClick = void BeforeDoubleClick(handle Target, bool Cancel)
BeforeRightClick = void BeforeRightClick(handle Target, bool Cancel)
Activate = void Activate()
Deactivate = void Deactivate()
Calculate = void Calculate()
Change = void Change(handle Target)
FollowHyperlink = void FollowHyperlink(handle Target)
PivotTableUpdate = void PivotTableUpdate(handle Target)
>>

if your realtime data triggers the Change event then you can use handle.listener to call your code

>> handle.listener(sheet, 'Change',{@mycode sheet});

Good Luck,

Donn
 | 
Pages: 1
Prev: Matrix Sub-section
Next: Matrix Sub-section