- #1
Ally1
- 3
- 0
In many cases one finds code such as
x = linspace(-3,1.5,200);
y = linspace(-3.5,3.5,200);
[X,Y] = meshgrid(x,y);
Z = X +Y*i;
%Euler's Method
M = abs(1+Z);
[c,h] = contour(X,Y,M,[1,1]);
set(h,'linewidth',2,'edgecolor','g')
to plot the stability region of the Euler's Method, where in fact the definition of is Z = lambda*h, where h is a step-size and lambda an eigenvalue.
1. How do I modify this program the above in terms of Z = lambda*h?
2. How do I plot different regions on same plot?
Thanking you in advance.
x = linspace(-3,1.5,200);
y = linspace(-3.5,3.5,200);
[X,Y] = meshgrid(x,y);
Z = X +Y*i;
%Euler's Method
M = abs(1+Z);
[c,h] = contour(X,Y,M,[1,1]);
set(h,'linewidth',2,'edgecolor','g')
to plot the stability region of the Euler's Method, where in fact the definition of is Z = lambda*h, where h is a step-size and lambda an eigenvalue.
1. How do I modify this program the above in terms of Z = lambda*h?
2. How do I plot different regions on same plot?
Thanking you in advance.