Matlab 3D Plot Multiple surfaces
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yellow Canary
el 19 de En. de 2015
Comentada: Prachi Arora
el 9 de Jun. de 2018
I have two functions that I need to compare on a single figure. I want see which function gives higher results. For example, I want my first function to have blue dots on z-axis, and second function to have red dots on z-axis again. So, I can see both results on the same figure. I calculated the results for both function on Matlab and imported the results excel file. I know how to plot single function but don't have any idea how to plot both on a single figure. How can I do this? For my current figure I use
plot3(Pa,Pb,Profit1)
Also, I tried to use surface (surf) but it didn't work. Maybe surface would be better to see the difference between these two function.
Thank you everyone in advance.
0 comentarios
Respuesta aceptada
Star Strider
el 19 de En. de 2015
See if this does what you want:
N = 1000;
x = rand(N,1);
y = rand(N,1);
z1 = 20+0.5*randn(N, 1);
z2 = 10+0.5*randn(N, 1);
figure(1)
scatter3(x, y, z1, '.b')
hold on
scatter3(x, y, z2, '.r')
hold off
grid on
xlabel('x')
ylabel('y')
zlabel('z')
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!