Click here to Skip to main content
15,867,453 members
Articles / MatLab
Tip/Trick

Matlab Delta Cursors

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
14 Feb 2013CPOL 13K   164   2   1
Delta Cursors For Use In Matlab Figures

Image 1

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionhelp Pin
plg_swpu28-Jun-13 16:09
plg_swpu28-Jun-13 16:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.