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.
0 件のコメント
採用された回答
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 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!