3D plot on 3D matrix

4 Ansichten (letzte 30 Tage)
salad9996
salad9996 am 29 Jul. 2020
Kommentiert: Leela Aparna am 6 Mär. 2023
Hi guys, suppose I have a 3D array which look like this. How do I do the plotting with these data?
  3 Kommentare
salad9996
salad9996 am 29 Jul. 2020
X having the values of 1:5:50, Y is the column, and Z
Leela Aparna
Leela Aparna am 6 Mär. 2023
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?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KSSV
KSSV am 29 Jul. 2020
Bearbeitet: KSSV am 29 Jul. 2020
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 Kommentare
salad9996
salad9996 am 29 Jul. 2020
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 am 30 Jul. 2020
x = 1:5:50 ;
y = 1:size(val,2) ; % define your y here
[X,Y] = meshgrid(x,y) ;
surf(X,Y,val(:,:,1)') ;

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Discrete Data Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by