필터 지우기
필터 지우기

How to draw a 3D plot from an excel data?

조회 수: 6 (최근 30일)
student_md
student_md 2021년 2월 22일
댓글: KSSV 2021년 2월 23일
How to draw a 3D plot from an excel data? Please click for downloading following Excel Data (or find attachment)
(maybe mesh 3d plot or surfc plot)
(First column is x-values, first row is y-values.)

채택된 답변

KSSV
KSSV 2021년 2월 22일
num = xlsread('test3.xlsx') ;
x = num(2:end,1) ;
y = num(1,2:end) ;
Z = num(2:end,2:end) ;
surf(x,y,Z')
  댓글 수: 3
student_md
student_md 2021년 2월 22일
편집: student_md 2021년 2월 22일
Dear @KSSV,
Is something wrong in the code?
In fact;
this excel data is values of z=sin(x)*cos(y)
where
x=[-2*Pi, 2*Pi],
y=[-2*Pi, 2*Pi]
KSSV
KSSV 2021년 2월 23일
x=linspace(-2*Pi,2*Pi) ;
y=linspace(-2*Pi,2*Pi) ;
[X,Y] = meshgrid(x,y) ;
Z = sin(x).*cos(y) ; % element by element multiplication
surf(X,Y,Z)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by