MATLAB Answers

Determine if a value has changed after some operations?

조회 수: 19(최근 30일)
Xiaohan Du
Xiaohan Du 23 Apr 2018
Answered: Guillaume 23 Apr 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.

  댓글 수: 0

로그인 to comment.

답변 수 (1)

Guillaume
Guillaume 23 Apr 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

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by