Plot3 to import data from Excel

조회 수: 3 (최근 30일)
marie lasz
marie lasz 2021년 6월 11일
댓글: Walter Roberson 2021년 6월 11일
Hello all,
I am getting problem in plotting a 3D plot , where I am importing data from an excel sheet.Code and data can be seen below; Kindly correct me and needs your guidance.
Thanks in advance :-)
[x,T,xT] = xlsread('calculations.xlsx','test1','A2:A8');
[x1,T,x1T] = xlsread('calculations.xlsx','test1','B2:B8');
[x2,T,x2T] = xlsread('calculations.xlsx','test1','C2:C8');
[x3,T,x3T] = xlsread('calculations.xlsx','test1','D2:D8');
[x4,T,x4T] = xlsread('calculations.xlsx','test1','E2:E8');
[w,T,wT] = xlsread('calculations.xlsx','test1','F2:F8');
[w1,T,w1T] = xlsread('calculations.xlsx','test1','G2:G8');
[w2,T,w2T] = xlsread('calculations.xlsx','test1','H2:H8');
b=x(:,1);
c=x1(:,1);
d=x2(:,1);
e=x3(:,1);
f=x4(:,1);
g=w(:,1);
h1=w1(:,1);
i=w2(:,1);
plot3(b,c,d,e,f,g,h1,i,'-.')
zlim([0 60]);
xlim([0 8 ]);
ylim([0 2]);
Fig = figure(1);
set(Fig, 'color','white');
xlabel( 'Image Numbers');
ylabel( 'NC');
zlabel('Quality Factors');
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 6월 11일
No worksheet named 'test1' in the file.
marie lasz
marie lasz 2021년 6월 11일
Oh sorry it didn't save the name.

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

답변 (1개)

KSSV
KSSV 2021년 6월 11일
T = xlsread('calculations.xlsx') ;
plot(T(:,1),T(:,2:end))
  댓글 수: 3
KSSV
KSSV 2021년 6월 11일
surf(T(:,2:end))
Walter Roberson
Walter Roberson 2021년 6월 11일
T = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/649670/calculations.xlsx');
surf(T(:,2:end))

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

카테고리

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