Boris Kaus
ETH Zurich
Some reasons to use MATLAB
10 0.9
9 0.8
0.7
8
0.6
7
0.5
6
0.4
5
0.3
4
0.2
3
0.1
2
0
1 -3 -2 -1 0 1 2 3
1 2 3 4 5 6 7 8 9 10
150 0.6
1
100 0.4
0.5 50 0.2
Slow Decay
Fast Decay
0 0
0
-50 -0.2
-0.5
-100 -0.4
-1 -150 -0.6
-200 -0.8
-1.5 0 2 4 6 8 10 12 14 16 18 20
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
Time (sec)
Some more elaborate 2D plots
Gorczyk et al.
(2006), G-cubed
What about 3D?
-2
-4
-6
25
-8
0
20 surf(peaks(20))
5 15
10 10
15
5
20
25 0
Height
8 4
4 2
2
0
0
shading interp;
-2
h=colorbar
-4
-6
25
-2 title(h,height)
-8
20
0
5 15
-4 load clown
10 10
surface(peaks,flipud(X),...
15 'FaceColor','texturemap',...
5 -6
20 'EdgeColor','none',...
25 0
'CDataMapping','direct')
colormap(map)
Velocity
Example of quiver3
1
0.8
0.8
0.6 0.6
0.4 0.4
0.2 0.2
0
0
-0.2
-0.2
-0.4
-0.4
-0.6
-0.6
-0.8 1.5
-1 1
0.5 3
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
2
0 1
-1
-1
0
[x y z v] = flow;
h=contourslice(x,y,z,v,[1:9],[],[0], linspace(-8,2,10));
axis([0 10 -3 3 -3 3]); daspect([1 1 1])
Made with sliceomatic (later). camva(24); camproj perspective;
campos([-3 -15 5])
set(gcf, 'Color', [.3 .3 .3], 'renderer', 'zbuffer')
Bucky ball set(gca, 'Color', 'black' , 'XColor', 'white', ...
'YColor', 'white' , 'ZColor', 'white')
box on
Combined stuff
load wind
figure;
cla
spd = sqrt(u.*u + v.*v + w.*w);
p = patch(isosurface(x,y,z,spd, 40));
isonormals(x,y,z,spd, p)
set(p, 'FaceColor', 'red', 'EdgeColor', 'none');
p2 = patch(isocaps(x,y,z,spd, 40));
set(p2, 'FaceColor', 'interp', 'EdgeColor', 'none')
daspect([1 1 1]);
[f verts] = reducepatch(isosurface(x,y,z,spd, 30), .2);
h=coneplot(x,y,z,u,v,w,verts(:,1),verts(:,2),verts(:,3),2);
set(h, 'FaceColor', 'cyan', 'EdgeColor', 'none');
[sx sy sz] = meshgrid(80, 20:10:50, 0:5:15);
h2=streamline(x,y,z,u,v,w,sx,sy,sz);
set(h2, 'Color', [.4 1 .4]);
colormap(jet)
box on
axis tight
camproj perspective;
camva(34);
campos([165 -20 65]);
camtarget([100 40 -5])
camlight left;
lighting gouraud
Maps etcetera. (partly with mapping toolbox)
80
60
40
20
-20
-40
-60
-80
from: http://www.mathworks.com/matlabcentral/fileexchange
Melt-channels?
But: