MATLAB: How to do pcolor plots

3d matrixpcolor

Hi all,
I've attached an example of the plot that I want to make it. it shows on x-axis = depth y-axis = time z-axis = temperature. the mother matrices have the same dimensions (251*28*10) I need also to extract the 5th column from all of it (251*5*10) the result previous matrix what I want to plot if with pcolor
any help will be appreciated 🙁
thanks

Best Answer

A = rand(251,28,10) ; % some dummy data for demo
[m,n,p] = size(A) ;
% Extract 5th column from each matrix
iwant = zeros(m,1,p) ;
for i = 1:p
iwant(:,:,i) = A(:,5,i) ;
end
iwant = squeeze(iwant) ;
pcolor(iwant) ;
shading interp ;
colorbar