When I try to use the function 'magic(n)', Matlab says that the execution of the script magic is not supported
조회 수: 5 (최근 30일)
이전 댓글 표시
M = magic (300)
Execution of script magic as a function is not supported:
/Users/helloooo/Documents/MATLAB/magic.m
댓글 수: 0
답변 (2개)
Steven Lord
2022년 10월 5일
Rename the magic.m file that you've created in the /Users/helloooo/Documents/MATLAB folder. It's preventing MATLAB from accessing the magic function included in MATLAB.
댓글 수: 0
Benjamin Thompson
2022년 10월 5일
If your magic.m file does not have "function" at the top, then it is a script and not a function. Scripts cannot be passed arguments in parenthesis. They would normally share the same workspace as the caller.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!