- When you use a function instead of a script, there are more opportunities for optimization
- When you use a script instead of a function, the entire workspace of the caller of the script is right there, and any changes you make to variables inside the script potentially affect the caller. The script needs to be careful not to accidentally affect the caller in ways the caller is not expecting
Syntax clarity on function
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a script that goes like:
The script name is also ManageX. It doesn't look like there is any input or output. Why do we need this function here then, I wonder?
function ManageX
if
end
if
end
댓글 수: 1
Walter Roberson
2020년 7월 18일
답변 (1개)
Vimal Rathod
2020년 7월 23일
Hi,
You can have a look at some of the answers to this question link given below. There was a healthy discussion in the forum regarding this.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!