Detect changed value in an array

5 ビュー (過去 30 日間)
Praveen Choudhury
Praveen Choudhury 2016 年 2 月 22 日
回答済み: goerk 2016 年 2 月 22 日
I have an array of m*1 size. I want to detect the changes in the values in the array. Is there some function like ischanged in simulink? Or can anyone tell me how to do it.

回答 (1 件)

goerk
goerk 2016 年 2 月 22 日
You can simply compare a copy of the original vector with the actual vector.
A = [1 ;2; 3];
B=A;
B(1)=5; % change the array
changedMask = A~=B

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by