Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"No appropriate method" error generated when calling new function using class-defined object

I defined a class called "FilterCriteria" which has a bunch of function .m files (getAMask, getBMask, etc.) associated with it. When I create the FilterCriteria object and call the functions using it, I don't have any problems. However, recently I added another function (which, on a side note, is almost identical to another function that still works), and Matlab returns the error, "No appropriate method, property, or field getHMask for class FilterCriteria."

I've searched online for this problem, but I can't find anything. The file getHMask.m is definitely in the correct folder, so I don't understand why Matlab seems to have such a problem finding it.

Here's getHMask.m's header:

function mask = getHMask(object, quadrant, channel)

Any help would be greatly appreciated. Thanks in advance.

like image 815
Nicole Ouellette Avatar asked Dec 05 '25 18:12

Nicole Ouellette


1 Answers

1) A mistake I make sometimes is not saving the file with the correct name. Make sure capital letters are in the right places etc!

2) Another layer of error checking here... You can call methods('object here') (see here) and make sure it lists the method (function) that you are trying to add to it. If it doesn't show up here you should check into the implementation of the method and make sure it's correctly being added to the class you're using for your object.

like image 77
Ben A. Avatar answered Dec 08 '25 17:12

Ben A.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!