recipes : Statistics : Displaying data in a grid

Problem

How can I examine data in a spreadsheet style?

Solution

The MATLAB GUI provides an interface for interacting with data in a spreadsheet style manner. If it's not visible then you can just use the openvar command.

data=eye(15)+rand(15)*0.8; %make some data
openvar('data') %bring up the "spreadsheet"
Discussion

It's important to consider why you want access to the data via the spreadsheet-like grid. It's great if you need to edit numbers in an array for some reason. However, those coming from an Excel background have a tendency to examine a spreadsheet for trends. Don't do this! Here's why: try typing the above lines of code and examining the grid of numbers for trends. Nothing really jumps out at you (although if you take your time you will see stuff). Now try plotting the data with imagesc(data). You should see a very obvious pattern right away. Go on, try it!

This is the first lesson in statistics: make the right plot and don't examine grids of numbers for trends. I'll say that again in case you missed it the first time: do not make a "speadsheet" and then start examining the raw numbers in the spreadsheet for trends, outliers, or what have you. It's a really crap idea and it doesn't work. Learn to use the plotting tools MATLAB provides. If you can make the right plot and clearly display important trends then you'll have a much better idea what formal statistical test is needed. For this reason, many of the recipes in the statistics section of this site are about how to plot data.