How to calculate slope/gradient in 3D surface data

80 次查看(过去 30 天)
I have this matlab data that looks like this,
X = 1:15;
Y = [5 5 5 10 15 20 25 25 25 20 15 10 5 5 5];
dx = 1;
dy = 1;
Z = (ones(numel(X),1)*Y)+ randn(15,15)
figure
surf(Z)
ylabel('y-axis [um]');
xlabel('x-axis [um]');
zlabel('z-axis [um]');
Im trying to find a way to automatically determine the slope of this 3D surface but I couldnt find it. Can anyone help me?

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-4-27
编辑:Ameer Hamza 2020-4-27
X = 1:15;
Y = [5 5 5 10 15 20 25 25 25 20 15 10 5 5 5];
dx = 1;
dy = 1;
Z = (ones(numel(X),1)*Y)+ randn(15,15);
figure
surf(Z)
title('surface');
figure
surf(gradient(Z))
title('gradient');

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by