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 CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by