필터 지우기
필터 지우기

How can I plot 4-dimensional plot?

조회 수: 3 (최근 30일)
Anshul Jain
Anshul Jain 2021년 1월 12일
댓글: KSSV 2021년 1월 12일
Respected sir,
I am attaching an excel file here.
I want a plot between columns' values F, G, H and I for 216 values in such a manner that values of l1, l2 and l3 should be along X, Y and Z axes and plot of values of Lz in between.
Here, every value of l1, l2 and l3 leads to the value of the corresponding value of Lz and the range of each one of l1, l2 and l3 is between 800 to 1200.
Kindly let me know how to draw this plot.
Thanks in advance.
Anshul

답변 (1개)

KSSV
KSSV 2021년 1월 12일
Have a look on slice.
T = readtable('Book1.xlsx') ;
l1 = T.l1 ;
l2 = T.l2 ;
l3 = T.l3 ;
Lz = T.Lz ;
nx = length(unique(l1)) ;
ny = length(unique(l2)) ;
nz = length(unique(l3)) ;
X = reshape(l1,nx,ny,nz) ;
Y = reshape(l2,nx,ny,nz) ;
Z = reshape(l3,nx,ny,nz) ;
C = reshape(Lz,nx,ny,nz) ;
figure
hold on
for i = 1:nz
surf(X(:,:,i),Y(:,:,i),Z(:,:,i),C(:,:,i))
end
  댓글 수: 4
Anshul Jain
Anshul Jain 2021년 1월 12일
Respected Sir,
Thank you once again.
It is a 4-D plot but sir in the middle portion, I want the value of Lz.
Right now, the plot I am getting in the middle portion is not for Lz (as per the plot is looking) [Attached file]
Kindly help.
Sorry for any inconvenience.
KSSV
KSSV 2021년 1월 12일
REad about slice. This is your function. I mentioned this already.

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

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by