Determine if a value has changed after some operations?

조회 수: 9 (최근 30일)
Xiaohan Du
Xiaohan Du 2018년 4월 23일
답변: Guillaume 2018년 4월 23일
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.

답변 (1개)

Guillaume
Guillaume 2018년 4월 23일
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

카테고리

Help CenterFile Exchange에서 Manage Products에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by