how to Shading the intersection area?

4 Ansichten (letzte 30 Tage)
sadeem alqarni
sadeem alqarni am 30 Sep. 2018
Kommentiert: sadeem alqarni am 1 Okt. 2018
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 Kommentare
KSSV
KSSV am 1 Okt. 2018
You need to explain more....question is not clear.
sadeem alqarni
sadeem alqarni am 1 Okt. 2018
   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))

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by