Determine if a value has changed after some operations?

4 visualizaciones (últimos 30 días)
Xiaohan Du
Xiaohan Du el 23 de Abr. de 2018
Respondida: Guillaume el 23 de Abr. de 2018
Hi all,
How can I determine if a value has changed or not after some operations? For example:
testA = valueA;
% after some operations, testA = valueA or valueB;
% if value of testA changes, continue operation, elseif unchanges, cease operation.

Respuestas (1)

Guillaume
Guillaume el 23 de Abr. de 2018
testA = valueA;
oldtestA = testA;
%... do some operations that may change testA
if oldtestA ~= testA %assuming that testA is scalar
%value has changed
else
%value has not changed
end

Categorías

Más información sobre Argument Definitions en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by