How to react on a change of variable from workspace?
이전 댓글 표시
I would like to have an opportunity to react on value change of any workspace variable during any script runnig or commandline working. I would like to avoid using timer object, which can be used as speedy value checker . I would like to have ValueChangeFcn callback, or sort of that.
댓글 수: 2
Oleg Komarov
2011년 2월 4일
A thought (not an expert here): overloading subsasgn to check for every NEW assignment?
Siddharth Shankar
2011년 2월 4일
Could you provide a little more background? How are these variables in the workspace changing? Who modifies the values, and would it be possible for the program/process that modifies these values to also notify you of having made the change?
채택된 답변
추가 답변 (2개)
Brett Shoelson
2011년 2월 4일
1 개 추천
I like Siddharth's answer. But as an alternative, you could create a timer object (help TIMER) that, in its callback, looks at the value of a workspace variable and compares it to the old value.
Cheers, Brett
roshana
2011년 4월 12일
0 개 추천
I have a problem, and that's the value for the variables i use in the mfile never change. every time i modify the m file, for instance try to get result with a different image again the m file is run with the same old values. note: I also execute "clear" in the command windows to clear the workspace.
댓글 수: 1
Walter Roberson
2011년 4월 12일
That really should be posed as a new question.
The first thing to try is
rehash
If that does not work, you may have saved your files in one of the toolbox directories, which will cause multiple problems. The work-around is to
rehash toolbox
카테고리
도움말 센터 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!