no data appearing in my plot
显示 更早的评论
I am trying to plot the phase velocity (mupe/mupm) as it changes as a function of the frequency (f). I'm not sure what is missing in my code to fix it. I tried adding axes to see if the data was where I thought it'd be but there wasn't any data there either.
epsilono = (10^-9)/(36*pi);
muo = 4*pi*(10^-7);
a = 0.9;
b= 0.4;
fe = (1/2*epsilono*muo)*sqrt((1/a)^2+(0/b)^2);
fm = (1/2*epsilono*muo)*sqrt((1/a)^2+(1/b)^2);
f = (8.24*10^9):(0.1*10^9):(12.4*10^9);
fef = rdivide(fe, f).*rdivide(f, fe);
fem = rdivide(fm, f).*rdivide(f, fm);
mupe = 1./(sqrt(1-fef));
mupm = 1./(sqrt(1-fem));
betae = 2.*f.*pi.*sqrt(muo*epsilono).*sqrt(1-fef);
betam = 2.*f.*pi.*sqrt(muo*epsilono).*sqrt(1-fem);
lambdae = 2*pi./betae;
lambdam = 2*pi./betam;
figure;
plot(abs(mupe), f);
ylabel('Phase Velocity')
xlabel('Frequency')
title('Frequency vs. Phase Velocity')
3 个评论
Samuel Anderson
2018-3-13
Abraham Boayue
2018-3-13
Hey Samuel, Can you post the formular of the phase velocity that you are trying to plot? And the parameters too. I'm afraid to say that your code appears bit odd and uncleared. rdivide is hardly used for making division in matlab.
Murali Krishna
2018-3-24
Hello Samuel
fef = rdivide(fe, f).*rdivide(f, fe);
fem = rdivide(fm, f).*rdivide(f, fm);
By this statements the value of fef and fem will always be 1.Hence values of mupe and mupm will be infinite.
I think because of this you are not able to see the plot.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!