フィルターのクリア

3D Figure from Excel (x,y,z)

6 ビュー (過去 30 日間)
Isabella
Isabella 2024 年 6 月 19 日
コメント済み: Star Strider 2024 年 6 月 20 日
I have been trying to create a 3D representation of my data for an ellipsoid-shaped measurement. I have x (length), y (width), and z (intensity) data and have been able to create plots in the past for a variation of this data (y was time). The data is 300x3 (100x1 for each value). For this project, I am struggling to create a 3D figure for my data. I have tried using surf, ellipsoid, fimplicit3, and a bunch of different functions. I'm attaching an image of the desired shape.
Does anyone have any ideas for what code or function I should try instead?

採用された回答

Star Strider
Star Strider 2024 年 6 月 19 日
It always helps to have your data. A picture may be worth a thousand words, however on MATLAB Answers, data is worth a thousand pictures.
imshow(imread('Screenshot 202....10.09 AM.png'))
Perhaps something like this —
N = 25;
r = linspace(0, 1, N).';
[X,Y,Z] = cylinder(r.^2-1);
X = 5*X;
figure
surfc(Z, X, Y)
grid on
axis('equal')
colormap(turbo)
xlabel('X')
ylabel('Y')
zlabel('Z')
view(-40,30)
ylim([min(ylim) 0])
I use surfc here because I want to be certain what the surface does. Use surf tto plot without the contour lines. Use the view function to orient it the way you want it.
.
  2 件のコメント
Isabella
Isabella 2024 年 6 月 20 日
This worked beautifully!! You are a (MATLAB) genius!! Thank you so, so much :))
I'm still learning and was like just not able to get any farther with the figures, so I really really appreciate your help!!
Star Strider
Star Strider 2024 年 6 月 20 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by