cell function not enough input arguments

Hi guys, I'm trying to run a function on a cell, e.g.
function [imagesS] = silhouette(A)
for ii = 6:length(A)
imagesS{ii} = im2bw(A{ii}, 0.6);
end
end
Which I call from another script,
imagesS = silhouette(A);
Where 'A' is a cell containing images. The error message I get is 'not enough input arguments', which doesn't make much sense to me. Any help appreciated.

 Akzeptierte Antwort

Wayne King
Wayne King am 19 Mai 2013

0 Stimmen

I think the problem you are having is that you likely have the Statistics Toolbox installed. There is a function called silhouette() in the Statistics Toolbox.
That function takes more than 1 input argument.
If you enter
>>which silhouette
at the command line, what do you get back?
If it is something like:
matlab\toolbox\stats\stats\silhouette.m
then that is your problem.
It's never a good idea to have functions named the same as MathWorks' functions. I suggest you rename your function, mysilhouette.m, or whatever you like, but not silhouette.m.
Also, make sure your function is on the MATLAB path. Whatever folder you have the function in, you have to add that folder to the MATLAB search path.

Weitere Antworten (0)

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by