How do I display proportions of 3 materials per cell in a 10x10 grid?

1 view (last 30 days)
So here is a basic example:
Suppose I know the make-up of 100 different places on a big slab of rock (in a 10x10 grid). The rock is made of 3 materials. the amount of each material is different at each spot on the rock.
say the three materials are iron, aluminum and copper. One place might be 22% copper, 43% iron and 35% aluminum, and another place could be 58% copper, 12% iron and 30% aluminum.
I know the percentages of each material at each spot.
How could I represent that information in one image? I want to show how much of what is where inside the rock.
I can easily represent one material at a time using a 3D surface with z as the percentage of that material and x and y as a 10x10 grid. But I need to show all three at each point. 2D or 3D it doesn't matter.
If I'm not being clear enough just let me know.
Any help will be much appreciated, I really need to get this done right away. Thanks

Accepted Answer

Aaron
Aaron on 23 Jul 2011
ok so here is what I did in the end:
I made three matrices (x,y,z1 x,y,z2 x,y,z3) x=1:10 and y=1:10 then I subtracted the matrices from one another z1-z2 and z1-z3, then I cut and pasted the two resulting matrices into excel. In excel I made a third matrix out of the first two. For the third matrix: any cell that had a negative value on either of the first two matrices was copied as a 0 onto the third. then I copied the lowest value between the first two matrices in each cell into the corresponding cell in the third matrix. I placed this resulting matrix back into matlab and made an image, setting the color map to black at zero and light green to dark green for the rest. I did the same thing two more times (z2-z1,z2-z3 and z3-z1,z3-z2) and colored the other two images the same way but with a different color (i.e. blue instead of green).
so now I have 3 images, I just have to make a composite of this by removing all the black cells and laying what's left on top of each other. viola, now I have a map of what item is most prominent at each location and to what degree.
I don't know if I described it very well but it was easy and didn't take long. I'm putting this up in case someone else runs into a similar problem.

More Answers (1)

bym
bym on 23 Jul 2011
how about turning your components into a colormap triple and displaying the image?
[edit]
x= 100* rand(10);
y = rand(100,3);
image(x);
colormap(y);
  3 Comments
Aaron
Aaron on 23 Jul 2011
that is really not coming out to be what I want, I may be doing it wrong though, I have very little experience with matlab.
I'll put it another way: I have a 10x10 grid of xy points, with 3 distinct z values at each xy point. (x,y,(z1,z2,z3)) in a 3D plot

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!