Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
i got this error
조회 수: 1 (최근 30일)
이전 댓글 표시
Attempt to execute SCRIPT contour as a function:
C:\MATLAB\SupportPackages\R2016a\contour.m
Error in contour (line 3)
contour(X,Y,Z),xlabel('x'),ylabel('y')
댓글 수: 0
답변 (2개)
madhan ravi
2019년 4월 20일
편집: madhan ravi
2019년 4월 20일
Same issue as your previous question. https://in.mathworks.com/matlabcentral/answers/457478-i-received-this-error#answer_371434
댓글 수: 0
Image Analyst
2019년 4월 20일
You appear to have a script called contour.m. This script takes no arguments - that's why it's a script and not a function. Unfortunately you called this the same name as a built-in function called contour() and you seem to be wanting to call the built-in function countour() from your script also called contour. But when you called your script contour, this takes precendence over the built-in function, so on line 3 when you call contour(X, Y, Z), it's calling your script instead of the built in contour() function. (To add insult to injury, it's trying to call it recursively) However your script contour does not take/accept any arguments like X, Y, or Z, so that's why you get the error.
Rename your script to contour_test.m and it should work (as long as you define X, Y, and Z.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!