フィルターのクリア

Is there a way to find slope at any point on the graph?

9 ビュー (過去 30 日間)
kanyvt
kanyvt 2015 年 4 月 9 日
コメント済み: Star Strider 2015 年 4 月 9 日
I have plotted a graph (I-V curve of transistor) and I need to find slope at various points as encircled. What is the way to do so? Thanks, Kany

採用された回答

Star Strider
Star Strider 2015 年 4 月 9 日
The easiest way is to use the gradient function. (I believe you forgot to upload your plot, but that doesn’t affect my Answer.)
If you then want the slope at particular values of your x-variable, use the find function to detect the indices of those values, then use the indices to find the value of the gradient at those values.
  4 件のコメント
kanyvt
kanyvt 2015 年 4 月 9 日
Yeah you are right, the length is same in the gradient vector. But the problem is how to verify which way of finding slope is correct ? Sometimes the results from gradient function and diff function vary a lot.
Star Strider
Star Strider 2015 年 4 月 9 日
If you have constant, equal spacing of your independent variable, gradient is preferable. If you have unequal independent variable spacing, diff may be more accurate in some situations.
However, you can convert unequal spacing to equal spacing with the interp1 function. So it would likely be easier and more accurate to define equally-spaced independent variable values and interpolate their corresponding dependent variable values with interp1 and use gradient for the derivative, remembering to define the independent variable constant spacing interval in your call to gradient.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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