Matlab 3D Plot Multiple surfaces

4 次查看(过去 30 天)
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.

采纳的回答

Star Strider
Star Strider 2015-1-19
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')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by