please ,write a code to 3D plot this file .

14 vues (au cours des 30 derniers jours)
Ali Moosazadeh
Ali Moosazadeh le 8 Fév 2025
Commenté : Ali Moosazadeh le 9 Fév 2025
column 1,2,3 are x,y,z respectively. please write the code . thanks

Réponses (2)

Sam Chak
Sam Chak le 8 Fév 2025
I am unsure about the specific type of 3D plot you require. I reviewed your previous questions and found that you have already learned how to extract the data. Once you have the coordinates, you need determine the type of 3D plot for them.
data= readmatrix('scd.xlsx');
x = data(:,1);
y = data(:,2);
z = data(:,3);
scatter3(x, y, z) % <-- probably this line is new to you
  1 commentaire
Ali Moosazadeh
Ali Moosazadeh le 8 Fév 2025
can you write the code using surf function ?

Connectez-vous pour commenter.


Torsten
Torsten le 8 Fév 2025
Déplacé(e) : Image Analyst le 8 Fév 2025
data= readmatrix('scd.xlsx');
x = data(:,1);
y = data(:,2);
z = data(:,3);
F = scatteredInterpolant(x,y,z);
xq = linspace(min(x),max(x),100);
yq = linspace(min(y),max(y),100);
[Xq,Yq] = meshgrid(xq,yq);
Zq = F(Xq,Yq);
surf(Xq,Yq,Zq)
colorbar

Community Treasure Hunt

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

Start Hunting!

Translated by