My code: s = input('Enter length of side');
Error shown: Attempt to execute SCRIPT input as a function: \\hs8.lboro.ac.uk\psyd3\MATLAB\input.m
Error in IsTriangle_With_Errors (line 5) s1 = input('Enter shortest side of Triangle:');

댓글 수: 2

Dennis
Dennis 2018년 7월 5일
It seems like you wrote a script named input.m. Try to rename that.
Yash Deshpande
Yash Deshpande 2018년 7월 5일
I had written a script input.m, I renamed it. Did not work.
Tried deleting it. Still didn't work

댓글을 달려면 로그인하십시오.

 채택된 답변

Rik
Rik 2018년 7월 5일

0 개 추천

You learned a valuable lesson: don't shadow Matlab functions. You should write functions (or scripts) with names like sum or input etc. You can check if a function exists by a name you're planning to use by entering the name in the documentation search box in the top of your Matlab window, or in the online doc for your release.

댓글 수: 5

or calling
which function_name -all
Yash Deshpande
Yash Deshpande 2018년 7월 5일
I had written a script input.m, I renamed it. Did not work.
Tried deleting it. Still didn't work
Stephen23
Stephen23 2018년 7월 5일
편집: Stephen23 2018년 7월 5일
@Yash Deshpande: show us the complete output of this command:
which input -all
Yash Deshpande
Yash Deshpande 2018년 7월 5일
Sorry, my bad. Got it. I had not deleted properly. It is working now.
Rik
Rik 2018년 7월 5일
BTW, you should be aware that the offline doc search and which only work for the toolboxes you have installed.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2018년 7월 5일

댓글:

Rik
2018년 7월 5일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by