Error "not enough input arguments"

1 view (last 30 days)
Hi all, I'm new to MatLab and I'm trying to run this code below with the file saved as eigencentrality.m and when I run in Command it gives the above error.
Have searched the forum but unable to figure out the solution for this. Please help.
%eigen centrality
function x=eigencentrality(A)
[V,D]=eig(A); [max_eig,ind]=max(diag(D)); x=V(:,ind);

Accepted Answer

Star Strider
Star Strider on 4 Feb 2016
You have to call your function as:
A = [1 2; 3 4];
x=eigencentrality(A)
You cannot run it as you would a script.
  4 Comments
vignesh raju
vignesh raju on 4 Feb 2016
Thanks a lot. It worked.

Sign in to comment.

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!