Skip to Main Content Skip to Search
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Inside the MATLAB Desktop

May 12th, 2008

Brush up on your data

We’ve already received great feedback on Data Brushing, a new MATLAB R2008a feature that is closely related to Data Linking.

Data Brushing allows you to graphically edit the data in a plot, allowing you to clean up the data, or focus in on a particular region. Unlike Plot Tools, which allow you to edit the graphics of the plot (labels, legend, colors, etc), this feature works on the actual data in the plot.

Here I’ve taken the L-shaped membrane (MathWorks logo) and brushed the flat part. I changed the color of the brushing from the default red to hot pink for better contrast (The color can be changed by clicking the drop-down button next to the brush icon).

MATLAB L-shaped membrane with brush markers

Right-clicking the brushed area gives options to delete the data (for cleaning up outliers), replacing the data with a new value, or various copy options. Here’s what happens if I replace the flat area with NaN’s:

MATLAB L-shaped membrane after brushing

You can also drag the highlighted region into Microsoft Excel or a text editor and it will give you a table of the highlighted data.

As a bonus, if you have data linking turned on, the changes are reflected back in the workspace. If you haven’t already watched the tutorial video, I suggest you take a look at it.

By combining brushing with linking, you get a nice tool for data exploration and data manipulation that allows you to work in one domain, when the data you care about is visualized in another domain. Two great uses come to mind: filter design and principal component anaylsis–basically anytime you want to look at the same data in multiple ways at the same time. The above linked video shows this with highway safety data.

These tools give a lot of flexibility and ease of manipulating graphs. Please exercise responsible presenting.

Leave a Reply


Inside the MATLAB Desktop is written by the MATLAB Interface teams.

Team picture
  • Etienne: Hello, Is it possible to change the background color of a particular cell?
  • Ken: No problem Mark…glad to help. Enjoy your font!
  • Mark Andrews: Ken, thanks for replying @3 and giving such clear instructions on how to get this to work.
  • Steve Eddins: Hi Ken, Every year or so I try to find a programming font that would really make me happy. A couple of...
  • Ken: @Jiro: Andale Mono looks nice! I especially like the rendering of the letter “g”.
  • Ken: Hi Mark, The issue your referring to (see the bug report here) was fixed in version 7.5 (R2007b). The problem...
  • Jiro: Ken, That’s a nice font. I use “Andale Mono” which has a similar look. I also like the clear...
  • Queffurust: This is my “cleanup” ; shortcut clc % clear Command Window close all hidden % deletes all...
  • Mark Andrews: Ken, should this work with version 7.0 (R14) on Windows? My favorite font is Consolas, but MATLAB seems...
  • Mark Feldman: Like Bryan (#38) and Kim (#40), I strongly request that you add native vi key bindings to the MATLAB...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.

Related Topics