Plot Sea Current in Time vs Depth

조회 수: 4 (최근 30일)
eko supriyadi
eko supriyadi 2017년 8월 8일
댓글: KSSV 2017년 8월 8일
Hello everyone!
I'm trying to plot a contour of sea current with time (in month) on the x axis vs depth (in meter) on the y axis.
The data (excel) is attached
I'v tried multiple times to do this but cant seem to work it out
Thanks in advance!!

채택된 답변

KSSV
KSSV 2017년 8월 8일
[num,txt,raw] = xlsread('current data') ;
depth = num(:,1) ;
currents = num(:,2:end) ;
[nx,ny] = size(currents) ;
%%plot of currents vs depth
figure
hold on
for i = 1:ny
x = 1:12 ;
y = currents(i,:) ;
z = depth(i)*ones(size(x)) ;
plot(x,y,'color',rand(1,3))
end
  댓글 수: 2
eko supriyadi
eko supriyadi 2017년 8월 8일
thanks for your reply. It's work if i'm required the line graph.. but, i need like this image (attach).
contour not line graph.
thanks
KSSV
KSSV 2017년 8월 8일
It's good you have attached a image....
[num,txt,raw] = xlsread('current data') ;
depth = num(:,1) ;
months = 1:12 ;
[X,Y] = meshgrid(months,depth) ;
currents = num(:,2:end) ;
contourf(X,Y,currents)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by