Plot 2 coordinates with different color and different size to the rest?

1 次查看(过去 30 天)
The absolute max is 40 at (2,2) and the absolute min is at -0.125 at (1/2,0). How can I make these 2 points bigger and in a different color to the other 3 points? What can I add to this code?
% Code Plane and Boundaries for the graph with the closer look
x=linspace(-5,6,50);
y=x;
[X,Y]=meshgrid(x,y);
Z=2.*X^4-X.^2+3.*Y^2;
surfl(X,Y,Z)
grid on
hold on
x1=linspace(0,16,30);
y1=linspace(0,0,30);
z1=2.*x1.^4-x1.^2;
plot3(x1,y1,z1,'r*','Markersize',15)
hold on
x2=y1;
y2=x1;
z2=28+3.*y2.^2;
plot3(x2,y2,z2,'r*','Markersize',15)
hold on
x3=x1;
y3=x3;
z3=2.*x3.^4-x3.^2+3.*y3.^2;
zlim([-5,45]);
xlim([-1,3]);
ylim([-5,15]);
plot3(x3,y3,z3,'r*','Markersize',15)
hold on
crx=[-1/2, 1/2,0, 2, 2];
cry=[0, 0, 0, 0, 2];
crz=2.*crx.^4-crx.^2+3.*cry.^2;
plot3(crx,cry,crz,'bd','Markersize', 15,'Markerfacecolor','b')
hold off
  3 个评论
Alejandro Avelar
Alejandro Avelar 2019-4-23
By bigger I mean make the absolute max and min bigger in size than the other 3 points
darova
darova 2019-4-23
Use max(). Analogically min()
[~, ind] = max(z(:));
plot3(x(ind),y(ind),z(ind),'og','MarkerSize',15)

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by