Interpolate 4D Scatter?

10 ビュー (過去 30 日間)
Hank Negi
Hank Negi 2019 年 7 月 23 日
回答済み: Walter Roberson 2019 年 7 月 23 日
Hello, I was wondering if anyone could possibly help me with something for class. The goal was to make a 4D scatter plot, with the 4th dimension an output (in this case "D"). The x,y,z points are inputs. I can produce the scatter plot with colorbar and it looks good, but I was wondering if there is a way I could interpolate between the points as well to get a 4D surface?
x = [13.48, 13.7, 12.25, 12.84, 12.6, 13.89, 14.81, 12.27, 12.16, 12.82, 13.04, 12.92]';
y = [13.31, 13.04, 20.65, 30.67, 31, 31.31, 30.83, 31.41, 31.87, 32.39, 30.37, 30.41]';
z = [16.5, 16.54, 12.43, 8.48, 8.25, 8.17, 8.56, 8.27, 7.86, 7.97, 8.24, 8.69]';
D = [11134, 11064, 10122, 10999, 10812, 10642, 10324, 10625, 10501, 10244, 10464, 10439]';
scatter3(x, y, z, 20, D,'filled')
colorbar
title('Graph Title')
xlabel('x')
ylabel('y')
zlabel('z')
Scatter4D.jpg

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 7 月 23 日
Not really.
You can do a gridded interpolant https://www.mathworks.com/help/matlab/ref/griddedinterpolant.html over a grid defined by min and max x y z values. That would get you a cuboid of values that you would have to slice() or isosurface() for presentation. It is unlikely to be the surface you are looking for.
Perhaps you should instead use boundary() to find an enclosing set of points, after which you could patch() the surface with CData set to something extracted from D, and probably with face color interpolation.

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by