How to plot 3d surface plot from excel data

31 vues (au cours des 30 derniers jours)
Vishal Guggari
Vishal Guggari le 29 Mar 2022
Modifié(e) : Tala le 30 Mar 2022
clc
clear all
T = readmatrix('C:\Users\visha\Desktop\Data set.xlsx')
x = T(:,1)
y = T(:,2)
z = T(:,3)
[X,Y]=meshgrid(x,y)
surf(X,Y,z)
xlabel('X')
ylabel('Y')
zlabel('Plastic Strain')

Réponse acceptée

Tala
Tala le 29 Mar 2022
Modifié(e) : Tala le 29 Mar 2022
Source is Here.
Use this:
T = readmatrix('Data.xlsx');
x = T(:,1);
y = T(:,2);
z = T(:,3);
[Ux,iax,ixx] = unique(x);
[Uy,iay,ixy] = unique(y);
N = 25; % adjust
xv = linspace(min(x), max(x), N);
yv = linspace(min(y), max(y), N);
[Xm,Ym] = ndgrid(xv, yv);
Zm = griddata(x, y, z, Xm, Ym);
figure
surfc(Xm, Ym, Zm)
  2 commentaires
Vishal Guggari
Vishal Guggari le 29 Mar 2022
Thanks alot.
Tala
Tala le 29 Mar 2022
Modifié(e) : Tala le 30 Mar 2022
anytime

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by