# Surface Modeling of Processed Material

3 views (last 30 days)
Joe on 1 Oct 2016
Answered: Anusha Sridharan on 5 Oct 2016
Matlab beginner/novice here...
Trying to evaluate some of the capabilities of Matlab as a possibility against current software used for surface modeling of a given manufacturing process. Basically I want to see visually how much a given material is removed during a manufacturing process. We measure pre and post thickness and then calculate a removal rate based on those measurements. The concern is that the entire surface area of this material needs to have a uniform rate of removal. To visualize data we use contour plots that show "hot spot trends" to interpret local uniformity issues.
So for a circular sample size of 200mm we measure 33 points around the surface to collect data. Say with below example data:
if true
% code
No. X [mm] Y [mm] Z [mm]
1 145 0 57.8073
2 108.75 0 58.2118
3 72.5 0 58.13596
4 36.25 0 54.33299
5 0 0 57.33287
6 -36.25 0 57.80064
7 -72.5 0 58.1187
8 -108.75 0 57.7595
9 -145 0 57.33799
10 0 -145 57.0659
11 0 -108.75 57.8753
12 0 -72.5 58.07226
13 0 -36.25 55.86238
14 0 36.25 57.86338
15 0 72.5 57.96141
16 0 108.75 58.39304
17 0 145 57.78718
18 102.53 -102.53 7.44282
19 76.898 -76.898 58.14284
20 51.265 -51.265 58.14595
21 25.633 -25.633 57.66489
22 -25.633 25.633 57.81209
23 -51.265 51.265 58.15967
24 -76.898 76.898 58.20979
25 -102.53 102.53 57.47371
26 -102.53 -102.53 57.9951
27 -76.898 -76.898 58.76738
28 -51.265 -51.265 52.44355
29 -25.633 -25.633 56.19073
30 25.633 25.633 51.07815
31 51.265 51.265 58.26303
32 76.898 76.898 50.23562
33 102.53 102.53 57.94507
The goal is to have some kind of contour or surface visualization for a given distribution like the attached photo.

Anusha Sridharan on 5 Oct 2016
You can do this in MATLAB by using a “Colormap.”
A colormap is a matrix of three columns whose values are between 0 and 1 that define the colors for objects.
Each row in the matrix defines one color using an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]. A value of 0 indicates no color and a value of 1 indicates full intensity.
You can use the “colormap” function to change the colormap of an axes or figure. You could create your own custom colormap or use MATLAB built-in colormaps.
Here’s an example of using a built-in colormap:
f = Figure %creates a figure
contourf(peaks) %contour plot
colormap(parula(12)) % set f to built-in colormap “parula”, the integer number specifies the number of colors to use from the parula colormap, 12 in this case.
Example to create custom colormap:
map = [0.2, 0.1, 0.5
0.1, 0.5, 0.8
0.2, 0.7, 0.6
0.8, 0.7, 0.3
0.9, 1, 0]; % this matrix defines a colormap containing five colors, the three columns stand for red,green and blue values respectively with intensities between 0 and 1.
surf(peaks);
colormap(map);

### Categories

Find more on Colormaps in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!