Undefined function 'nmf' for input arguments of type 'double'

4 Ansichten (letzte 30 Tage)
ihsan
ihsan am 16 Okt. 2012
i have made a function named nmf its sign is: function [ W,H ] = nmf(A,k,numOfIteration )
when i try to test this fınction with a A=rand(40,30); it says: Undefined function 'nmf' for input arguments of type 'double'
so what is the type of A in my fucntion? i tried nearly all types.any ideas?thank you.
  3 Kommentare
Walter Roberson
Walter Roberson am 16 Okt. 2012
Make sure the saved file is named nmf.m
ihsan
ihsan am 17 Okt. 2012
matt you are right.it is not in the path thank you.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Wayne King
Wayne King am 16 Okt. 2012
As Matt's comment correctly suggests, you have to add the folder (directory) where the function is located to the MATLAB path. If your function is in c:\mfiles for example, use
>>addpath 'c:\mfiles'
or use the
>>pathtool
to add the folder. The type error message is not saying the type is wrong, it's basically saying "you tried to call nmf() on a double input, but I don't know what nmf is".

Weitere Antworten (1)

Sachin Ganjare
Sachin Ganjare am 17 Okt. 2012
Probably you are trying to use 'nmf' function instead of 'nnmf' function in statistics toolbox.

Kategorien

Mehr zu Dimensionality Reduction and Feature Extraction finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by