how to minus a sequence value
4 ビュー (過去 30 日間)
古いコメントを表示
a=-4;
b=4;
x=a:1:b;
y=x.^2-4.*x;
from the above code, i will have value y= 32,21,12,5,0,-3,-4,-3,0
then, what i do do next is to find the difference between answer
ex:
abs|21-32|=11
abs|12-21|=9
abs|5-12|=7
and so on
0 件のコメント
採用された回答
Rik
2022 年 9 月 13 日
The diff function will do what you want. You can use abs to get the absolute value.
2 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!