At every value of x, how measure slope of plot?

1 回表示 (過去 30 日間)
MOHD UWAIS
MOHD UWAIS 2023 年 2 月 27 日
編集済み: Torsten 2023 年 2 月 27 日
clear all
clc
x=[15 20 25 30 35 40 45 50 55];
y=[11.89 11.845 11.85 11.855 11.865 11.93 12.01 12.2 12.77];
plot(x,y)

回答 (1 件)

Torsten
Torsten 2023 年 2 月 27 日
編集済み: Torsten 2023 年 2 月 27 日
Look at the approximate slope curve under
You cannot expect a simple explicit equation for it.
A possible function is given here as dy:
X=[15 20 25 30 35 40 45 50 55];
Y=[11.89 11.845 11.85 11.855 11.865 11.93 12.01 12.2 12.77];
dY = gradient(Y,5);
dy = @(x) interp1(X,dY,x)
dy = function_handle with value:
@(x)interp1(X,dY,x)
dy(22.8)
ans = -0.0012

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by