3D plot for repetitive data

11 次查看(过去 30 天)
I have 30 tables like the ones shown below with same e1 and e2 but different error. I am not sure what is the best way to show these results. I tired heat map but seems like its not possible since e1 has repetition. Can someone help me with this.
% e1 e2 error
[0.01, 0.01, 8.287423935;
0.01, 0.1, 8.430020284;
0.01, 0.5, 8.954563895;
0.1, 0.01, -1.004665314;
0.1, 0.1, -0.611359026;
0.1, 0.5, 0.094929006];

采纳的回答

Star Strider
Star Strider 2018-4-14
your data are gridded, so you can use the reshape function to convert them to the necessary matrices to plot them with surf, mesh, or contour.
Try this:
e1e2er = [0.01, 0.01, 8.287423935;
0.01, 0.1, 8.430020284;
0.01, 0.5, 8.954563895;
0.1, 0.01, -1.004665314;
0.1, 0.1, -0.611359026;
0.1, 0.5, 0.094929006];
e1r = reshape(e1e2er(:,1), 3, []);
e2r = reshape(e1e2er(:,2), 3, []);
err = reshape(e1e2er(:,3), 3, []);
figure(1)
surf(e1r, e2r, err)
grid on
view(45, 25)
xlabel('e_1')
ylabel('e_2')
zlabel('err')
It works.
  6 个评论
Isha Sharma
Isha Sharma 2018-4-18
Thanks! I will check this and edit accordingly. :)
Star Strider
Star Strider 2018-4-18
As always, my pleasure!

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by