|
借鉴了论坛大佬的code加上自己的修改添加,想要请问,最后怎么把scatter和plot的图分开显示在两个不同的图里面?
- x=[0 6.8 18.6 21.3 3 12.5 13 20.7 17.7 20.8 1.1 6.3 13.2 3.4 3.5 18.9 11.3 13.1];
- y=[1.7 1.1 0.8 1.2 3.1 3 3.1 4.2 4.1 5.8 6.4 5.8 7.4 5.3 5.9 9.7 7.6 10.7];
- z=[0.59 0.58 0.53 1.25 1.24 0.2 0.18 0.14 0.64 0. 1.06 0.73 0.15 0.15 0.1 0.08 0.17 0.8];
- scatter3(x,y,z)
- x=x';
- y=y';
- z=z';
- hold on
- Z=[ones(length(x),1),x,y,x.^2,x.*y,y.^2,x.^3,x.^2.*y,x.*y.^2,y.^3];
- A=Z\z;
- X=min(x)-1:0.2:max(x)+1;
- Y=min(y)-1:(max(y)-min(y)+2)/(length(X)+1):max(y)+1;
- [x y]=meshgrid(X,Y);
- z=A(1)+A(2)*x+A(3)*y+A(4)*x.^2+A(5)*x.*y+A(6)*y.^2+A(7)*x.^3+A(8)*x.^2.*y+A(9)*x.*y.^2+A(10)*y.^3;
- mesh(x,y,z)
- max_where=find(z==max(z));
- h = max(max(z)) %h deflection
- P = 10; % P Pressure, Unit: KPa
- a = 10; % a Bulge window size: nm
- v = 0.25; % v Possion's ratio
- t = 500; % t Thickness of the sample
- Sigma_xx = (P*R)/t % Stress
- E = ((P*4*(a^4))*(1-(v^2)))/(3*(h^3)*t) % E Young's modulus
- Epsilon = ((P*R)/t)*(1-(v^2))/E %Strain
- plot(Sigma_xx, Epsilon,'*')
复制代码
|
|