Error "not enough input arguments"

1 vue (au cours des 30 derniers jours)
vignesh raju
vignesh raju le 4 Fév 2016
Commenté : Star Strider le 4 Fév 2016
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);

Réponse acceptée

Star Strider
Star Strider le 4 Fév 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 commentaires
vignesh raju
vignesh raju le 4 Fév 2016
Thanks a lot. It worked.
Star Strider
Star Strider le 4 Fév 2016
My pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by