Using mouse for control in Matlab

So, it basically boils down to an old problem: how do I get some user-controlled inputs in Matlab?
Keyboard handling in real-time is basically nonexistant, joystick is alright, but the most easy way to get some input and freedom of controlling things is – to poll the mouse position.

Spoiler alert:

xy = get( 0, 'PointerLocation' )

Read more

Plot names in Matlab – using the ‘Tag’ property

Did you know you can tag the plots in Matlab for easier searching? Because I fuckin’ didn’t.

Why so brutal? Well, after 6 years of writing your PhD in Matlab you CAN become furious when you realise instead of keeping the links to the currently opened plots in a global variables and different lists you could’ve been naming them all that time…

Tag the plot: description for searching

aa = plot(2,2);
set(aa, 'Tag', 'foot trajectory' )
findobj('Tag','foot trajectory')
set( findobj('Tag','foot trajectory'), 'XData', [2 3], 'YData', '4 5')

… shit.