3D plot for repetitive data
11 views (last 30 days)
Show older comments
Isha Sharma
on 13 Apr 2018
Commented: Star Strider
on 18 Apr 2018
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];
0 Comments
Accepted Answer
Star Strider
on 14 Apr 2018
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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!