Input doesn't work
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
I was working on writing a script but when I included the input function I received the following error: Attempt to execute SCRIPT input as a function: /Users/Jzhang/Documents/MATLAB/input.m Error in circle_area (line 2) radius=input('Enter the radius:'); I've tried the input function in other scripts as well and they were working before but not anymore. Can anyone help me figure out this problem? Thanks
채택된 답변
Image Analyst
2013년 10월 8일
0 개 추천
Don't call it input.m. input is the name of a built-in function. Call it something else, like myInput().
댓글 수: 12
Jerry
2013년 10월 8일
I understand that input.m is a name of a built-in-function. For this example I wanted the user to input a number for the radius, so i wrote radius=input('Please enter the radius:'). However that didn't work
Image Analyst
2013년 10월 8일
Rename /Users/Jzhang/Documents/MATLAB/input.m to /Users/Jzhang/Documents/MATLAB/myinput.m or something like that.
Jerry
2013년 10월 8일
I tried that and it still doesn't work.
Walter Roberson
2013년 10월 8일
Okay now use
which -all input
and tell us what you get back.
Jerry
2013년 10월 8일
so instead of radius=input('.....') use radius=which -all input('....') ?
ES
2013년 10월 8일
no .. on the MATLAB command window, type
which -all input
it will show all the files with name input in your matlab path.
Jerry
2013년 10월 8일
oh i see, i got the following: >> which -all input /Users/Jzhang/Documents/MATLAB/input.m built-in (/Applications/MATLAB_R2013b.app/toolbox/matlab/lang/input) % Shadowed
ES
2013년 10월 8일
perfect... So rename the first file, to say 'troublesome.m'. Shadow effect will go. then run 'troublesome.m'
Hopefully your troubles will be gone.
Walter Roberson
2013년 10월 8일
That would not have happened if you had done the renaming that Image Analyst suggested. Though you might have needed to use the command
clear input
after you did the rename.
Jerry
2013년 10월 8일
I'm sorry I'm a beginner at matlab. So rename input.m to troublesome.m?
Jerry
2013년 10월 8일
nevermind, i got it. Thanks!
Image Analyst
2013년 10월 8일
Then please mark this answer as "Accepted."
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
