Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- figure(1);
- % first polygon (triangle)
- x1 = [0 0 1]';
- y1 = [0 1 0]';
- c1 = [1 3 9]';
- fill(x1, y1, c1);
- % second polygon
- x2 = [1 0 1]';
- y2 = [0 1 1]';
- c2 = [9 3 20]';
- hold on;
- fill(x2, y2, c2);
- grid on;
- colorbar;
- colormap(jet(12));
- # X Y Color
- 0 0 1
- 0 1 3
- 1 0 9
- 1 0 9
- 0 1 3
- 1 1 20
- figure(2);
- x1 = [0 1 0]';
- y1 = [0 0 1]';
- z1 = [0 0 0]';
- c1 = [5 2 6]';
- fill3(x1, y1, z1, c1);
- x2 = [0 0 0]';
- y2 = [0 1 0]';
- z2 = [0 0 1]';
- c2 = [5 6 9]';
- hold on;
- fill3(x2, y2, z2, c2);
- x3 = [0 1 0]';
- y3 = [0 0 0]';
- z3 = [0 0 1]';
- c3 = [5 2 9]';
- hold on;
- fill3(x3, y3, z3, c3);
- x4 = [1 0 0]';
- y4 = [0 0 1]';
- z4 = [0 1 0]';
- c4 = [2 9 6]';
- hold on;
- fill3(x4, y4, z4, c4);
- grid on;
- colorbar;
- colormap(jet(12));
- # X Y Z Color
- 0 0 0 5
- 1 0 0 2
- 0 1 0 6
- 0 0 0 5
- 0 1 0 6
- 0 0 1 9
- 0 0 0 5
- 1 0 0 2
- 0 0 1 9
- 1 0 0 2
- 0 0 1 9
- 0 1 0 6
Add Comment
Please, Sign In to add comment