how to Shading the intersection area?

조회 수: 2 (최근 30일)
sadeem alqarni
sadeem alqarni 2018년 9월 30일
댓글: sadeem alqarni 2018년 10월 1일
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에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by