请问matlab高手:用matlab画ezplot隐函数,为什么不出曲线?

来源:百度知道 编辑:UC知道 时间:2024/05/16 11:42:47
clc;
clear;
figure;
int n;
d=100;
alpha1=0.8451;
alpha2=0.6005;
c11=0.85*10^12;
c12=0.502*10^12;
c44=0.407*10^12;
n=0.4;
m=0.0725;
h=2;
x=0;
syms z;
g=z./d;
P=linspace(-5.0,0.5,5.0);
sigma=(c11+2.*c12).*m.*n;
w=(alpha2).*z+n.*pi;
alpha=(alpha1+i.*alpha2).^2;
r=(1-(c11+c44).*(1+P.*(alpha))./(c11.*(alpha)+c12))./(exp(i.*w));
y=-h.^2.*(pi)./d.*(sigma).^2./(c44.*(alpha2)).*r.*cos(2.*(pi).*x./d).*sin(w-(alpha2).*2.*(pi).*g).*exp(-(alpha1).*2.*(pi).*g);
ezplot(P,g,[0 0.1 2]);
grid;
真的很感谢您,我还想请教一个问题,如何将x=0和x=d/2两种情况下的图象进行拟和以得到P、g的关系曲线呢?
我的程序改成:
clc;
clear;
figure;
int n;
d=100;
alpha1=0.8451;
alpha2=0.6005;
c11=0.85*10^12;
c12=0.502*10^12;
c44=0.407*10^12;
n=0.4;
m=0.0725;
h=2;
x=0;
syms z;
g=z./d;
P=linspace(-5,5,10);
sigma=(c11+2.*c12).*m.*n;
w=(alp

【补充】
把ezplot(P,g,[0 0.1 2]); 改为
ezplot(g,P); 即可,是一条直线。

>> whos
Name Size Bytes Class Attributes

P 1x5 40 double
Y 1x1 538 sym
Y1 1x1 320 sym
alpha 1x1 16 double complex
alpha1 1x1 8 double
alpha2 1x1 8 double
ans 1x1 320 sym
c11 1x1 8 double
c12 1x1 8 double
c44 1x1 8 double
d 1x1 8 double
g 1x1 138 sym
h 1x1 8 double
m