# Puzzler: Working with polynomials11

This puzzler is very straightforward, so I hope to hear from some of the newer MATLAB users. I think the solution is very linear, most people would come up with the same solution. As a hint, be… read more >>

# MATLAB Basics: Setting edge color for large surface plots2

Often if you make a surface plot with SURF for a large dataset, it will appear all black because MATLAB is trying to draw all the edge lines. You can stop these lines from obscuring your data by… read more >>

# MATLAB Basics: Adding a toolbar to a GUI20

People often make their own GUIs in GUIDE and they have a data visualization. When you embed an axis in your own GUI rather than using a figure window, you lose the built in toolbar that has zoom,… read more >>

# MATLAB Basics: Interpolating data with interp11

This short video shows how you can take a sparsely sampled sine wave and use interp1 to interpolate the missing data points. Different interpolations such as linear, spline and nearest are all shown…. read more >>

# MATLAB Basics: Cell arrays for holding different data types7

Sometimes in MATLAB you are going to want to store different data types together in one construct rather than try and keep track of different variables. Structures work for this, but sometimes it is… read more >>

It is no secret that I like teaching MATLAB through videos. I use Camtasia to make and edit my videos, I am very happy using it. If you want to make MATLAB videos too, you can use Jing, by the… read more >>

# MATLAB Puzzler: Finding the two closest points29

Here is a new MATLAB Puzzler.
Given two vectors representing the X and Y coordinates of some points, find the two closest points in Cartesian space.

n = 10;
x = rand(1,n);
y = rand(1,n);