how to change variable value from another function
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi, is there any way to change the value of a and b without change the function's signature. like global variable in c?
댓글 수: 1
Stephen23
2018년 6월 22일
편집: Stephen23
2018년 6월 22일
"is there any way to change the value of a and b without change the function's signature"
There may well be, but it would be buggy, quite horrible code. Ugh, global variables....
I think the more important question is why do you want to do this? What is your actual reason for specifying "...without change the function's signature"? Why can't you change the function, or use function parameterization? It seems to me that this question shows a very high probability of this problem:
What is the real issue that you are having?
채택된 답변
Steven Lord
2018년 6월 22일
If by "implementation of brent" you mean Brent's method, depending on how that's implemented you may be able to write your function that accepts a, b, and c as inputs and use one of the parameterizing techniques from this documentation page to fix a and b and let the Brent's method implementation call the parameterized function with values for c as Stephen suggested.
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!