How to get slope over each grid?

2 次查看(过去 30 天)
Puspa patra
Puspa patra 2019-2-25
回答: KSSV 2019-2-27
I have a 3dimentional matrix , long*lat*monthly_mean_data, I want to plot slope over each grid showing the change in the data over the time for a year. can anyone help me out?
  3 个评论
Puspa patra
Puspa patra 2019-2-25
yes I want to calculate trend over time to represent my data, how it has changed over each grid,
below attached my mat file

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2019-2-27
Read about gradient
A = rand(10) ;
[dx,dy] =gradient(A) ; % get x2-x1, y2-y1
m = dy./dx ; % get slope
pcolor(m)
colorbar

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by