MATLAB: Do you know how can I fix this error? “Not enough input arguments” Thanks

errorfunctioninput

function r = rank(A,tol)
%RANK Matrix rank.
% RANK(A) provides an estimate of the number of linearly
% independent rows or columns of a matrix A.
% RANK(A,tol) is the number of singular values of A
% that are larger than tol.
% RANK(A) uses the default tol = max(size(A)) * eps(norm(A)).
s = svd(A);
if nargin==1
tol = max(size(A)) * eps(max(s));
end
r = sum(s > tol);
>>>Error using rank (line ) Not enough input arguments<<>> s = svd(A); <<<
My matrix is A=[1 4 3 7 ; 2 6 8 3 ; 1 3 4 5 ; 4 13 15 15] And I am trying to calculate rank of A.

Best Answer

  • How are you calling it?
    Are you including a value for ‘tol’ as your function requires?