⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 draw27linear.m

📁 这是一个matlab应用的论文和源代码
💻 M
字号:
function draw27linear(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];

% colormap('bone')

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,'linear'); % interpolation of Z by the known x,y,z
mesh(X,Y,Z) %draw 3D picture
hold on % keep the picture

plot3(x,y,z,'.','Markersize',5) % dotted 27 points

   % zlabel(ch); % z content
   
   title(ch) %
   text(-15,-10,0,'H2O') % peak 1
   text(105,0,0,'NaCl') % peak 2
   text(50,92,0,'NaH2PO4') % peak 3

% Xlabel={[              ]}


x0=[0 100 50 0];
y0=[0 0 86.6 0];
c=[0.4 0.8 0.5];  % color

plot(x0,y0); % 3 lines of the bottom
patch(x0,y0,c); % fill in the triangle with mixed color c
plot(x,y,'.','Markersize',5) % dotted 27 points
% colorbar % a color indicator of z value

[d,I]=max(z);
plot3(x(I),y(I),z(I),'v')
text(x(I),y(I),z(I)*1.1,'max')

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,20)
   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 + -