how to Shading the intersection area?

2 次查看(过去 30 天)
x0 = -5;
x1 = 5;
Nx = 301;
% Specify y range and number of points
y0 = -5;
y1 = 5;
Ny = 301;
% Construct mesh
xv = linspace(x0,x1,Nx);
yv = linspace(y0,y1,Ny);
[x,y] = meshgrid(xv,yv);
% Calculate z
q = x + i*y;
% 2nd order Runge-Kutta growth factor
g1=((196.*q.^4 - 108.*q.^3 - 1143.*q.^2 + 3888.*q + 5184).^(1/2) - 27.*q + 14.*q.^2 + 72)./(12.*(q.^2 - 6.*q + 12))
g2=-(27.*q + (196.*q.^4 - 108.*q.^3 - 1143.*q.^2 + 3888.*q + 5184).^(1/2) - 14.*q.^2 - 72)./(12.*(q.^2 - 6.*q + 12))
% Calculate magnitude of g
gmag1 = abs(g1);
gama2=abs(g2)
% Plot contours of gmag
contourf(x,y,gmag1,[1 1],'k');
hold on
contourf(x,y,gama2,[1 1],'r');
hold on
axis([x0,x1,y0,y1]);
axis('square');
xlabel('Real \lambda\Delta t');
ylabel('Imag \lambda\Delta t');
grid on;
figure
contour(x,y,[gama2,gmag1],[1 1],'r')
  3 个评论
KSSV
KSSV 2018-10-1
You need to explain more....question is not clear.
sadeem alqarni
sadeem alqarni 2018-10-1
   iwant to  Shading the intersection area for g1,g2 ?
  g1=((196.*q.^4 - 108.*q.^3 - 1143.*q.^2 + 3888.*q + 5184).^(1/2) - 27.*q + 14.*q.^2 + 72)./(12.*(q.^2 - 6.*q + 12))
   g2=-(27.*q + (196.*q.^4 - 108.*q.^3 - 1143.*q.^2 + 3888.*q + 5184).^(1/2) - 14.*q.^2 - 72)./(12.*(q.^2 - 6.*q + 12))

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by