フィルターのクリア

find difference between numbers

3 ビュー (過去 30 日間)
abbas hasan
abbas hasan 2013 年 1 月 18 日
hi everybody i start work with matlab from short time and i need yours helps i try to find the difference between five distances i.e if i have r1=5,r2=7,r3=9,r4=13,r5=18 and try to find the difference between r2-r1,r3-r2 ,.....,r5-r4 and write this code to work with for but it is not work the code is
a=[5,7,9,13,18]
for i=1:5
r(i)=a(i+1)-a(i)
end
i get this error
Attempted to access a(6); index out of bounds because numel(a)=5.
thanks

回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 1 月 18 日

abbas hasan
abbas hasan 2013 年 1 月 18 日
thanks it work correct

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by