Detect changed value in an array

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.

Antworten (1)

goerk
goerk am 22 Feb. 2016

0 Stimmen

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

Kategorien

Mehr zu Graphics Object Programming finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 22 Feb. 2016

Beantwortet:

am 22 Feb. 2016

Community Treasure Hunt

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

Start Hunting!

Translated by