using diff or gradient function normalized the vector
2 ビュー (過去 30 日間)
古いコメントを表示
for some reason when i use gradient function over a vector the scale get lowerd for example of sin function: the maximum is divided by 10 and in other cases the maximum is divided by something else
0 件のコメント
回答 (1 件)
Jos
2015 年 4 月 4 日
you have to divide by the time step. For instance, this gives you what you want
dt=0.1;
t=-2*pi:dt:2*pi;
subplot(3,1,1)
plot(t,sin(t))
subplot(3,1,2)
plot(t,gradient(sin(t),dt))
subplot(3,1,3)
plot(t(1:end-1),diff(sin(t))/dt)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Subplots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!