Undefined function for input type 'cell'

조회 수: 28 (최근 30일)
Andrew Chen
Andrew Chen 2018년 4월 29일
댓글: dpb 2018년 4월 30일
Hello,
I've encountered an interesting problem while making functions which I was not experiencing before. I've been going through my code to generalize it and separate it into more manageable sections by creating functions, and in one function I just created it I am getting the error
Undefined function 'myFunction' for input arguments of type 'cell'.
Which is strange because up to this point my custom functions have been not giving me this error when I pass a cell array to them and the code within the function should handle the cell array just fine, but the error seems to be rejecting the input all together any way without doing any operations on it since the error appears to be generated from the input being purely of a type cell.
Does anyone have any experience with such errors? Why should one pop up now when my other functions can handle cell arrays just fine?
Thanks for any help.
  댓글 수: 5
Andrew Chen
Andrew Chen 2018년 4월 30일
Thanks for the help dpb. It was a path problem. Sometimes it's the small things we forget to check and take for granted that end up being a problem. Thanks for the help though!
dpb
dpb 2018년 4월 30일
That's what was the which would show...once it was clear there wasn't something done in the function statement that was dependent upon calling class...I didn't (and don't) recall if the wording is slightly different for the extant function w/o a class variant from the totally missing or not which is why asked for function prototype info first...

댓글을 달려면 로그인하십시오.

채택된 답변

Andrew Chen
Andrew Chen 2018년 4월 29일
Well I have to say this is a bit embarrassing but I somehow managed to save the function in a directory other than the one it should have been in. Once moving the function to the proper directory everything worked fine.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by