Borrar filtros
Borrar filtros

Detect changed value in an array

5 visualizaciones (últimos 30 días)
Praveen Choudhury
Praveen Choudhury el 22 de Feb. de 2016
Respondida: goerk el 22 de Feb. de 2016
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.

Respuestas (1)

goerk
goerk el 22 de Feb. de 2016
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

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by