📄 draw27802.m
字号:
function draw27802(z,ch)
% input z, draw x-y-z 3d picture at 27 points,
% 'ch' is the title of z, a character string
% a subroutine programm. fan xiushan edited on 2000. 6.1
% 27 points for NaCl-HCl-H2O system 00.07.18 19:02
x1=[50 45 55 40 50 60 30 50 70 20 30 40 60 80 10 30 50];
x2=[70 90 5 0 10 20 40 60 80 100];
y1=[86.60 77.94 77.94 69.28 69.28 69.28 51.96 51.96 51.96...
34.64 34.64 34.64 34.64 34.64];
y2=[17.32 17.32 17.32 17.32 17.32 8.66 0 0 0 0 0 0 0];
x=[x1 x2];
y=[y1 y2];
xlin=linspace(0,100,100); % devided into 100 from 0 to 100
ylin=linspace(0,86.6,100); % devided into 100 from 0 to 86.6
% 27 z values have been existed in main program
[X,Y]=meshgrid(xlin,ylin); % produce tiny lattice (100X100)
Z=griddata(x,y,z,X,Y,'cubic'); % interpolation of Z by the known x,y,z
% colormap(bone);
mesh(X,Y,Z) %draw 3D picture
hold on % keep the picture
plot3(x,y,z,'.','Markersize',5) % dotted 27 points
title(ch) % the title
% zlabel(ch); % z content
[d,I]=max(z);
plot3(x(I),y(I),z(I),'k*')
da=num2str(d);
p= num2str(I);
out=[p '#'];
% text(x(I),y(I),z(I)*0.8,out)
text(x(4)-10,y(4),z(4),'4#')
text(x(9)+10,y(9),z(9),'9#')
text(x(7)-10,y(7),z(7),'7#')
axis on
% a movie
% n: rotating range; 20: viewing angle; drawnow: instant drawing
a='press anykey to adjust the angle , and press "Ctrl+C" to end ';
for n=-150:15:210
n
disp(a)
pause
view(n,35)
drawnow
end
d=num2str(d);
p= num2str(I);
out=['the lagest value is ' d ' and occurs at the ' p 'th point'];
disp(out)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -