why is this code showing zero for all equations??
古いコメントを表示
disp('Enter all values in row vector ');
x=input('Enter the values of x=');
y=input('Enter the values of function at x f(x)=');
val=input('Enter the value of x at which derivative is to be calculated=');
i=find(x==val);
fd=[y(i+1)-y(i)]/[x(i+1)-x(i)];
cd=[y(i+1)-y(i-1)]/[x(i+1)-x(i-1)];
bd=[y(i)-y(i-1)]/[x(i)-x(i-1)];
disp('Following are the Difference Derivatives')
disp(' FDD CDD BDD')
disp([fd cd bd])
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!