problem with sample function in matlab
조회 수: 2 (최근 30일)
이전 댓글 표시
hi,
i want to start with a sample function
1. % my first function in matlab
2. function y = FirstFct(x)
3.
4. y = x*x;
5. end
and i get this error:
Error using FirstFct (line 4) Not enough input arguments.
댓글 수: 1
Adib HARHOURI
2013년 3월 17일
Hi John ,
You must give a value for x
so try for example (on the command window) :
>>FirstFct(5)
>>y
you should get y=25
답변 (1개)
Walter Roberson
2013년 3월 17일
How are you starting up your function? It appears that you might be using F5 or using Run from the menus. To run a function that takes input arguments, you need to go to the command line and enter the call there, giving the inputs on that line. For example,
FirstFct(12303)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!