3-d order derivative
1 回表示 (過去 30 日間)
古いコメントを表示
Dear all,
there is the following problem with the calculation of a 3-d order derivative.
I have two vectors of lambda and refractive index, respectively. I take the 3-d order derivative using a gradient().
dndl=gradient(n)./gradient(lambda);
d2ndl2=gradient(dndl)./gradient(lambda);
d3ndl3=gradient(d2ndl2)./gradient(lambda);
When I use a relatively small number of points (for example 3000) , I get a smooth plot.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/893025/image.jpeg)
In the case of more points (30 000) there is some oscillation in the plot.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/893030/image.jpeg)
What is the reason of such behavior?
Thank you a lot.
2 件のコメント
Matt J
2022 年 2 月 13 日
What do you mean by "use more points"? If it's a different input array why expect the same results?
回答 (3 件)
Catalytic
2022 年 2 月 13 日
If the points are too close together, the difference between neighbours will be so small as to be dominated by floating point errors
参考
カテゴリ
Help Center および File Exchange で Spatial Search についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!