Hi i have a matlab code which i have attached with my data. When i run the code it gives error in line 54 stating not enough input argument. Can anyone please check the code for me cause i am new to matlab and advice me accordingly. Many Thanks

7 comentarios

madhan ravi
madhan ravi el 2 de Sept. de 2018
can you show us how you are calling cca function ?
Kaushal Kishore
Kaushal Kishore el 2 de Sept. de 2018
Calling the function by running it in editor
madhan ravi
madhan ravi el 2 de Sept. de 2018
D, P, epochs, Mdist, alpha0, lambda0 what are the values of these parameters?
Kaushal Kishore
Kaushal Kishore el 2 de Sept. de 2018
D is the data matrix, P=3, epochs=30, Mdist=squareform(pdist(D,'mahal')),alpha0=0.5 and lambda0= 3*max(std(D))
madhan ravi
madhan ravi el 2 de Sept. de 2018
can you upload your m file with all the datas in it? the one which you attached is the function file!
Kaushal Kishore
Kaushal Kishore el 2 de Sept. de 2018
I cannot attach the m file because it exceeds the limit.
madhan ravi
madhan ravi el 2 de Sept. de 2018
see the clear explanation in the answer below.

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Sept. de 2018

1 voto

When you run a function from the editor then no parameters are provided for it, and most attempts to reference the variables will give exactly the error message that you see.
When you run a function, MATLAB will not look in the calling environment to try to find variables with the same name as the parameters. You have to pass the values at the time the function is invoked.

1 comentario

Kaushal Kishore
Kaushal Kishore el 3 de Sept. de 2018
Hi i was able to run the cca function. I know want to plot the dy verses dx graph as shown in the code. Can you please help

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 2 de Sept. de 2018

Comentada:

el 3 de Sept. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by