packages/rol/example/PDE-OPT/topo-opt/multimat/plotresults.m
raw| 1 | function plotresults(M,N,T,width,height) |
| 2 | |
| 3 | data = load('design.txt'); |
| 4 | W = [2.70, 8.96, 7.75]; |
| 5 | X = []; |
| 6 | Y = []; |
| 7 | Z = []; |
| 8 | for i=1:M |
| 9 | A = data(((i-1)*(M+N)+1):(i*(M+N)),2:4); |
| 10 | x0 = (i-1)*width/M; |
| 11 | x1 = i*width/M; |
| 12 | for j=1:N |
| 13 | B = A(((j-1)*T+1):(j*T),3); |
| 14 | y0 = (j-1)*height/N; |
| 15 | y1 = j*height/N; |
| 16 | X = [X, [x0;x0;x1;x1]]; |
| 17 | Y = [Y, [y0;y1;y1;y0]]; |
| 18 | Z = [Z, W*B]; |
| 19 | end |
| 20 | end |
| 21 | |
| 22 | figure, |
| 23 | patch(X,Y,Z) |
| 24 | axis('equal','tight') |
| 25 | colorbar |