3D surface plot from 3 columns of excel data?

6 vues (au cours des 30 derniers jours)
John Schneider
John Schneider le 8 Juin 2021
Commenté : darova le 8 Juin 2021
Total newbie here.
I have 3 columns of data and I want to create a 3D scatter plot. I was able to impot the columns as three 18 x 1 cell arrays in m y workspace. Can anyone help with some basic steps? Thanks!
  6 commentaires
John Schneider
John Schneider le 8 Juin 2021
thanks again. this is what I imported
I tried the following commands:
plot (a,b,c)
surface (a,b,c)
I know this must be trivial, but this is my first time using Matlab
John Schneider
John Schneider le 8 Juin 2021
just attaching the file

Connectez-vous pour commenter.

Réponse acceptée

Scott MacKenzie
Scott MacKenzie le 8 Juin 2021
Here you go...
T = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/645855/P3%20data.xlsx');
x = T{:,2}; % Speed
y = T{:,3}; % Range
z = T{:,4}; % Cost
scatter3(x,y,z);
xlabel('Speed');
ylabel('Range');
zlabel('Cost');
  2 commentaires
John Schneider
John Schneider le 8 Juin 2021
that is awesome Scott, thanks!
darova
darova le 8 Juin 2021

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by