finding a change in a matrix

2 Ansichten (letzte 30 Tage)
joseph Frank
joseph Frank am 6 Feb. 2012
Hi,
I have a matrix in which each column is usually constant but sometimes the value changes. Is there a way to figure out where the change occurs without running loops? for example A=[ 1 2 3 4 5; 1 2 3 4 5; 1 2 2 4 5; 1 2 2 4 5]
is it possible to compute that observation A(3,3) has changed?

Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 6 Feb. 2012
changes_in_columns = diff(A,1,1)

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by