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)
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!