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

조회 수: 10 (최근 30일)
Ali Moosazadeh
Ali Moosazadeh 2025년 2월 8일
댓글: Ali Moosazadeh 2025년 2월 9일
column 1,2,3 are x,y,z respectively. please write the code . thanks

답변 (2개)

Sam Chak
Sam Chak 2025년 2월 8일
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
Ali Moosazadeh
Ali Moosazadeh 2025년 2월 8일
can you write the code using surf function ?

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


Torsten
Torsten 2025년 2월 8일
이동: Image Analyst 2025년 2월 8일
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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by