Indiana University
University Information Technology Services
  
What are archived documents?

In Matlab, how do I plot irregularly spaced data?

To plot irregularly spaced data in Matlab, use the griddata command.

Assume that a is a matrix with three columns, and that each row gives the three coordinates for one data point. The example below plots a surface that passes through each of the points given by a:

xmin = min(a(:,1)); ymin = min(a(:,2)); xmax = max(a(:,1)); ymax = max(a(:,2)); xi = xmin : 0.02*(xmax-xmin):xmax; yi = ymin : 0.02*(ymax-ymin):ymax; zi = griddata(a(:,1), a(:,2), a(:,3), xi', yi); surf(xi, yi, zi)

For more information about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.

Also see:

This is document afqy in domain all.
Last modified on July 21, 2008.
Please tell us, did you find the answer to your question?