Matlab and event-driven programs

Legacy support with Phidget21
David Young

Matlab and event-driven programs

Postby David Young » Sat Sep 11, 2010 4:42 am

The Phidgets documentation recommends using an event-driven style of programming in general, but also says that in Matlab polling is necessary because Matlab does not support function pointers.

I suspect the second statement may be out of date. Matlab does have "function handles" and these are used for event-driven programming, for example in the Image Acquisition Toolbox.

It seems a pity not to be able to exploit Phidgets' functionality fully in Matlab. I wondered if anyone could comment on whether there are any plans to update the Matlab interface to allow an event-driven style of programming?


Re: Matlab and event-driven programs

Postby AdamS » Mon Sep 13, 2010 9:33 am

There really isn't a matlab interface.

The code samples and that getting started were developed on an older version of matlab at the time which did not support event driven programming.

I imagine that event driven programming can be done in Matlab with Phidgets, as in Matlab you are only loading an external c library into your program. However this will depend on whether the Matlab connections to the library will be able to handle the events in the Phidgets c library.

We haven't had the opportunity to test this ourselves. I believe we are hoping to be able to move to a newer version of Matlab and test this out properly, but I am not sure when that will happen at this time.

User avatar
Lead Developer
Posts: 3141
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada

Re: Matlab and event-driven programs

Postby Patrick » Mon Sep 13, 2010 10:02 am

I have heard of people trying out the function pointer approach, but I'm not sure if they were successful.


David Young

Re: Matlab and event-driven programs

Postby David Young » Tue Sep 14, 2010 5:34 am

Thank you for the replies. Phidgets and Matlab seem like a natural combination (though of course I don't know whether they are used together a lot in practice) so an easy event-driven interface would be great.

I'll continue using Java as an adaptor for now (see my entry on a guitar player's hand movement monitor in the applications section of the forum for an example). If I get round to doing something more general at some point I'll let you know.

Return to “Matlab”

Who is online

Users browsing this forum: No registered users and 1 guest