65.9K
CodeProject is changing. Read more.
Home

Matlab Delta Cursors

starIconstarIconstarIconstarIconemptyStarIcon

4.00/5 (1 vote)

Feb 14, 2013

CPOL
viewsIcon

13433

downloadIcon

164

Delta Cursors For Use In Matlab Figures

Introduction 

Within Matlab Figures, there are no delta data cursors. You have to export the data tips and then do the math yourself. This is a simple solution.

Background

Since Matlab won't create the delta data cursors (data tips), here is a quick fix. This doesn't require much programming. Just adding the file to your path.

Using the code

Just add the file 'figureC.m' to your path. Replace calls to Matlab's built in 'figure' function with calls to 'figureC'. The custom figure will override the datacursormode's 'UpdateFcn' with its own custom function. It will automatically create the delta data cursors when there is more than one data cursor in a figure.

Points of Interest 

This function takes advantage of Matlab's 'UserData' which is embedded in every figure. Within UserData the reference data cursor object is stored. When data cursors update they use the embedded reference cursor object to find the delta and add it to the printout text.

History 

  • Initial release: 2/13/2013.