Receiving 'not enough input arguments' in code

조회 수: 7 (최근 30일)
Thomas Stowell
Thomas Stowell 2020년 2월 17일
편집: the cyclist 2020년 2월 17일
I keep receiving error message on line 4 " not enough input arguements", not sure how to rectify.
function D=areavol(A)
format
D= 0; % where D=parallelogram
if size(A,2)== 2
D=1;
end
Rank =rank(A); %get rank
[rows,~]=size(A); % get rows
if rows>rank
if D==1
printf("parallelogram can't be built.\n")
else
printf("parallelpiped can't be built.\n")
end
D=0;
return;
end
>> areavol
Not enough input arguments.
Error in areavol (line 4)
if size(A,2)== 2

답변 (1개)

the cyclist
the cyclist 2020년 2월 17일
편집: the cyclist 2020년 2월 17일
You need
rows>Rank
instead of
rows>rank
MATLAB is case-sensitive. It would be better to have named that variable something that is not a keyword (despite the different case). Then it would have been easier to catch that mistake (or never have made it in the first place).
Also, note that in the editor, MATLAB will have warned you (with a squiggly yellow line) that the variable Rank was never used.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by