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.

 采纳的回答

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.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by