Why appears error message using functions like floor, mod and rem?
이전 댓글 표시
I'm trying to make a script code in order to convert arabic number to roman numbers. I some cases, when I use functions to separate the quantity by thounsands, hundreds, tens, etc., error messages appear as the following:
>> floor(2780,1000)
??? Error using ==> floor
Too many input arguments.
The same occurs when I use mod or rem functions. So, what could be the writing error or argument type to this kind of error messages appears?
댓글 수: 2
Les Beckham
2018년 3월 11일
편집: Les Beckham
2018년 3월 11일
Did you, perhaps, mean the following?
floor(2780/1000)
The results of this would be 2.
Floor does not, as I recall, accept more than one argument, thus the error message. You can, of course, pass an array to floor but this is still just one argument.
Les Beckham
2018년 3월 12일
Perhaps I should clarify that Matlab interprets commas inside of function calls as a separator between arguments. Thus, your original call to floor has two arguments (2780 and 1000), separated by the comma.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!