create new matrix with another matrix (downsampling)

hi
i have a 1xm matrix 'A' and want to make a new matrix that is 1xn 'B'
matrix B has values from matrix A IF the change in values are greater than 5 each time (if A(1,m)-A(1,m+1)>5)
(B is kinda down sample of A with a thereshold in pairs)

1 件のコメント

Dyuman Joshi
Dyuman Joshi 2021 年 4 月 11 日
B=A(diff(A)>5)
note that diff(A) is A(i+1) - A(i) and not A(i) - A(i+1) as you mentioned.

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

回答 (0 件)

カテゴリ

質問済み:

2021 年 4 月 9 日

コメント済み:

2021 年 4 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by