Hi guys, suppose I have a 3D array which look like this. How do I do the plotting with these data?

댓글 수: 3

Matt J
Matt J 2020년 7월 29일
Plot of what versus what?
salad9996
salad9996 2020년 7월 29일
X having the values of 1:5:50, Y is the column, and Z
Leela Aparna
Leela Aparna 2023년 3월 6일
Similarly I have two 3 dimensional matrices say A and B with same size. I want plot a graph to show the relation between those two matrices. In my case Size of A=17x17x8 and size of B=17x17x8. How can I plot the graph between these two?

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

답변 (1개)

KSSV
KSSV 2020년 7월 29일
편집: KSSV 2020년 7월 29일

0 개 추천

You can use pcolor/ surf. You can plot w.r.t indices.
val = rand(10,5,2) ;
% using pcolor
subplot(211)
pcolor(val(:,:,1))
shading interp
colorbar
subplot(212)
pcolor(val(:,:,2))
shading interp
colorbar
% using surf
subplot(211)
surf(val(:,:,1))
shading interp
colorbar
subplot(212)
surf(val(:,:,2))
shading interp
colorbar

댓글 수: 6

salad9996
salad9996 2020년 7월 29일
What is the use of sub function? I dont have the Fixed-Point Designer in my Matlab
KSSV
KSSV 2020년 7월 29일
It should be subplot. Type error..
salad9996
salad9996 2020년 7월 29일
Given the x=1:5:50, y would be the value of each column,if we only consider the first column of each index, y=val(:,1,:), and z represent the index, which the y in each index will be having a difference value. How do I plot the 3d graph in this case?
Walter Roberson
Walter Roberson 2020년 7월 29일
Sorry, I do not understand what you are asking... too many "index".
Are you saying that the first column of val() gives the y values?
What kind of plot are you hoping for? When you have three independent dimensions (row, column, pane) and one dependent dimension (the content of val), then you need a 4D plot. You could use isosurface() or slice() or you could use volumeViewer() or any similar routine in which the content of each 3D location is given by color and you cannot see "inside" unless transparency is used.
salad9996
salad9996 2020년 7월 29일
Im hoping to plot a graph with the x-axis from x=1:5:50 and the y-axis data would change depending on the z index, val(:,:,z).
KSSV
KSSV 2020년 7월 30일
x = 1:5:50 ;
y = 1:size(val,2) ; % define your y here
[X,Y] = meshgrid(x,y) ;
surf(X,Y,val(:,:,1)') ;

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

카테고리

도움말 센터File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

질문:

2020년 7월 29일

댓글:

2023년 3월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by