I have an array created with this command
t = [0:0.01:0.99 1:0.1:9.9 10:1:100];
this creates 281 columns
I want to know difference between each columns
like time interval between 2nd and 1st colulmn and between 2nd and 3rd like wise.
How do i go about it?

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 11 日

0 投票

Use diff()
t = [0:0.01:0.99 1:0.1:9.9 10:1:100];
dt = diff(t);

2 件のコメント

Prasanth Warrier
Prasanth Warrier 2020 年 11 月 11 日
Thanks Ameer
Ameer Hamza
Ameer Hamza 2020 年 11 月 11 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Matrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by