Do you know how can I fix this error? "Not enough input arguments" Thanks

2 views (last 30 days)
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.

Accepted Answer

Star Strider
Star Strider on 1 May 2015
How are you calling it?
Are you including a value for ‘tol’ as your function requires?
  10 Comments
Keti Kapa
Keti Kapa on 4 May 2015
Plz can you run this command? and insert this matrix which I mentioned above. Determinant is zero and it displays in command window which I do not want, I used semicolon for that. still does not work
Star Strider
Star Strider on 4 May 2015
When I run the det function with it independently, the deteminant is 0.
If you don’t want it displaying in the Command Window, you have to put the semicolon after the call to the function:
y=davaleba(a);
The semicolon after the first line of the function itself does nothing.

Sign in to comment.

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!