Reputation: 43
I am trying to plot the function as shown in figure below:
where the red curve denote for V = 200*1.6*1e-22
and the blue curve denotes for V = 285*1.6*1e-22
clear all
close all
clc
syms phi
l = 50*1e-9;
D = 200*1e-9;
E = 80*1.6*1e-22;
v = 1e+6;
h = 6.626*1e-34/(2*pi);
V = 200*1.6*1e-22;
ky = (2*pi/l).*sin(phi);
q_x = sqrt((E - V).^2./((h*v).^2 - ky.^2));
% vpa(q_x,5)
T = cos(phi).^2./(1 - cos(q_x.*D).^2.*sin(phi).^2);
ezpolar(T)
It works great but I want to show the plot only between the -90 < phi < 90
, I tried ezpolar(T,[-pi/2 pi/2])
it gives the plot in region -90 to 90 but the empty region does also appear. How to remove that left half semicircular area where the plot is not there.
Upvotes: 2
Views: 87
Reputation: 5190
Assuming you want to evaluate the function in the (x,y)
interval x=(-1,1)
and y(-1,1)
you can define a grid of X
and Y
values using the functin meshgrid
Edit
Updated the call to surf
(ref. to the comment from Hunter Jiang)
a=0.000000000142
X=[-1:.1:1];
Y=X;
[x,y]=meshgrid(X,Y);
z=2*cos(sqrt(3).*y.*a) + 4*cos((sqrt(3).*y.*a)/2).*cos((3.*x.*a)/2) - 1;
%surf(z)
surf(x,y,z)
Then you can use the function surf
to plot the results.
Upvotes: 2