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.

 채택된 답변

Wayne King
Wayne King 2013년 5월 19일

0 개 추천

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에 대해 자세히 알아보기

질문:

2013년 5월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by