Please How I can use meshgrid with x and y are the elements of the matrix A and plot a figure like in the picture

조회 수: 2 (최근 30일)
x = linspace(0,3);
y = linspace(-2*pi,2*pi);
[X,Y] = meshgrid(x,y);
A=[x,2;0,y];
Z = exp(det(A)) + cos(Y);
contourf(X,Y,Z)

채택된 답변

Walter Roberson
Walter Roberson 2022년 8월 9일
편집: Walter Roberson 2022년 8월 9일
This does not look like a contour plot at first, but notice the upper right corner.
syms P Q
D = det([P, 2; 0, Q]);
x = linspace(0,3);
y = linspace(-2*pi,2*pi);
[X,Y] = meshgrid(x,y);
A = double(subs(D, {P,Q}, {X, Y}));
Z = exp(A) + cos(Y);
contourf(X, Y, Z)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by