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.

1 件のコメント

James
James 2013 年 5 月 19 日
thanks, that was it

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by