Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Erasing part of contourf diagram (L-shaped diagram using contourf)
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have three matrices. First one is values of temperatures in (x,y) points, and second and third matrix is x and y coordinates, respectively. Rectangular block with temperatures is on figure(1) and it looks appropriately, but when I tried to neglect the values x>2 and y<2, to get L-shaped diagram, it doesn't look fine. Is there any solution to this problem? I submit the picture how the figure(2) should look.
Temp=[20 20 20 20 20; % y=0
18 18 18 18 18; % y=1
16 16 16 16 16; % y=2
14 14 14 14 14; % y=3
12 12 12 12 12]; % y=4
x_points=[0 1 2 3 4;
0 1 2 3 4;
0 1 2 3 4;
0 1 2 3 4;
0 1 2 3 4];
y_points=[0 0 0 0 0;
1 1 1 1 1;
2 2 2 2 2;
3 3 3 3 3;
4 4 4 4 4];
figure(1) % Rectangular block with temperatures
contourf(x_points,y_points,Temp)
figure(2) % L-shaped block with temperatures
Temp1=Temp
Temp1(1:2,4:5)=NaN
contourf(x_points,y_points,Temp1)
0 commentaires
Réponses (1)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!