Why am I getting this error for Fspecial?

14 vues (au cours des 30 derniers jours)
Amanda
Amanda le 4 Nov 2013
Commenté : Amanda le 4 Nov 2013
Hello, I'm just trying to run the fspecial function. This is the error I keep getting:
Undefined function 'checknargin' for input arguments of type 'double'.
Error in fspecial>ParseInputs (line 242) checknargin(1,3,nargin,mfilename);
Error in fspecial (line 97) [type, p2, p3] = ParseInputs(varargin{:});
I've looked at the function, and do not see a checknargin function defined.
I've uninstalled and reinstalled Matlab thinking that maybe the file was corrupted somehow. I still have this error. I've commented out this line, and it goes to the next check* function and says there is an error...
Can someone please tell me how to fix this?
Thank you!

Réponse acceptée

Wayne King
Wayne King le 4 Nov 2013
Are you sure that you are using MathWorks' version of fspecial()?
If you enter
>>which fspecial
Do you get something back like:
matlab\toolbox\images\images\fspecial.m
Then how are you attempting to call fspecial.m
Please show your call.

Plus de réponses (1)

Amanda
Amanda le 4 Nov 2013
No. I was not getting that. It was accessing a version of the fspecial I'd saved in my Documents folder from my advisor. Thanks for recommending that! I've deleted my advisor's fspecial and now it is accessing the proper version. How could I do this without deleting the files? Is there a call I could use in the console? Or do I have to change my current folder every time so that Matlab is not confused?
Thank you!
  4 commentaires
Image Analyst
Image Analyst le 4 Nov 2013
I think you have to rename both the m-file name, and the function declaration line inside the m-file, right? Or maybe it's not required but it's recommended to avoid confusion.
Amanda
Amanda le 4 Nov 2013
Okay. Thanks so much for your help guys! I feel silly now.. in every other language you shouldn't name functions after built-in functions XD I don't know why I didn't think of that.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by