Plot level curves and projections as a contour
Mostrar comentarios más antiguos
I have created a surface plot for the function
and
as follows:
and
as follows:close all
clear all
N1 = 10;
N2 = 10;
x1 = linspace(-1,1,N1);
x2 = linspace(-1,1,N2);
a = -1;
b = 2;
dx2_1 = zeros(N1,N2);
dx2_2 = zeros(N1,N2);
F1 = @(x2,x1,b,a) x1*a*b*(1-2*x2)/(b-1-x2);
F2 = @(x2,x1,b,a) x1*a*b*x2/(b-1+x2);
for i = 1:N1
for j = 1:N2
if a > 0
dx2_1(i,j) = 2*F1((x2(j)-1),(x1(i)-1),b,a);
else
dx2_1(i,j) = 2*F2((x2(j)-1),(x1(i)-1),b,a);
end
end
end
figure(1)
surf(x1,x2,dx2_1)
xlabel('x_2')
ylabel('x_1')
And here's the out put that I got from the above surface plot.

I'm trying to project level curves of this surface onto the
plane and plot them with respect to
and a(by varying a) as a contour/streamlinre plot. Can someone please assist me with the code for this problem?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




