MATLAB Answers

Plot 3D surface from Excel .csv File

18 ビュー (過去 30 日間)
Hamid ElDarwich
Hamid ElDarwich 2021 年 8 月 29 日
コメント済み: Hamid ElDarwich 2021 年 8 月 29 日
I am trying to plot 3D surface from the attached excel csv file (data.csv).
I want the surface to be smooth if possible.
  • x = first column;
  • y = second column;
  • z = third column.
I am new to Matlab and I have been struggling to do it. Could you please help me?
Also, how could I annotate the minumum of the surface and its x and y coordinates as well.
Thanks a lot!


Simon Chan
Simon Chan 2021 年 8 月 29 日
You may extract the data using function readmatrix.
clear; clc;
rawdata = readmatrix('data.csv');
x = reshape(rawdata(:,1),[],51); % Reshape the column matrix into 51 columns
y = reshape(rawdata(:,2),[],51);
z = reshape(rawdata(:,3),[],51);
result as follows:
  5 件のコメント
Hamid ElDarwich
Hamid ElDarwich 2021 年 8 月 29 日
I really appreciate. I got a better understanding of how Matlab works from your answers as well. Thanks!


その他の回答 (0 件)




Community Treasure Hunt

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

Start Hunting!

Translated by