function refresh value when variable changes (pass by reference)?
조회 수: 7 (최근 30일)
이전 댓글 표시
Would it be possible to refresh a function's value?
Say, A =1; B = 1; f = [A B]
Now, if I change A = 3, how should I change f's value without typing f = [A B] again?
It is essentially just like pass by reference, but I thought it is very complicated to do that in Matlab if possible.
This problem occurs because I may want to add variable c to f later, so f = [A B C], and in that way I just need to declare f in the beginning and do not have to change f everywhere.
댓글 수: 0
답변 (1개)
David Sanchez
2013년 7월 17일
Your question is answered in another post, follow the link:
href = ""<http://www.mathworks.com/matlabcentral/answers/152</a>>
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!