How to plot a variable with 3 dimensions.

조회 수: 3 (최근 30일)
Alexandra Ridgway
Alexandra Ridgway 2017년 2월 15일
편집: Alexandra Ridgway 2017년 2월 16일
So the title doesn't really explain it very well, here is the script so far,
close all
clear all
clc
load colormap_anom.mat;
Global68=read_one_netcdf('ETOPO_dx_dy.nc');
LIG6=read_one_netcdf('ETOPO_LIG6_1y_ptrc_Y2600.nc');
LIG8=read_one_netcdf('ETOPO_LIG8_1y_ptrc_Y2600.nc');
depth=LIG6.deptht*(-1);
LIG6.Fer(find(LIG.Fer>1e4))=NaN;
LIG6Fe=LIG6.Fer*1000;
LIG8.Fer(find(LIG.Fer>1e4))=NaN;
LIG8Fe=LIG8.Fer*1000;
Feglobal68=(LIG6Fe-LIG8Fe);
I now want to plot Feglobal68 however it is three dimensions (360,180,31) so I can't. I want to plot it over the whole globe, so something like this,
contourf(Feglobal68(:,:,1));
However I don't want it to just be at the surface (',1), so next I've tried to add up the Feglobal68 at every depth level, at each coordinate and then plot that as so;
TotalFe=zeros(360,180,31)
for i=1:360
j=1:180
k=1:31
TotalFe(i,j,k)=Feglobal68(i,j,k)+Feglobal68(i,j,(k+1));
end
end
end
However it says 'index exceeds matrix dimensions'
Any ideas?
Thanks,
Alexandra

답변 (1개)

Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017년 2월 15일
Even if you get Matlab to make a dense 3d plot, you cannot see through the surface so it might be futile. One alternative is to create a Matlab UI with a slider that allows you to select the depth level and plots the corresponding surface contour.
  댓글 수: 1
Alexandra Ridgway
Alexandra Ridgway 2017년 2월 16일
I just want one final depth layer to plot but which has all the iron values from every depth layer added up so there is just one number to plot at the top...

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by