필터 지우기
필터 지우기

input arguments of type 'struct' !?

조회 수: 133 (최근 30일)
Jonathan Roy
Jonathan Roy 2012년 1월 26일
답변: Rakshith Vishwanatha 2020년 12월 10일
I got this error when I call a function (Undefined function or method 'ndsort' for input arguments of type 'struct'.)
I realy don't know the origin of this error. Im trying to run this code (NGPM -- A NSGA-II Program in Matlab v1.4 ) and it is the function ndsort who did this error...
if someone have a clue it will be very appreciate
thank !

채택된 답변

Aurelien Queffurust
Aurelien Queffurust 2012년 1월 26일
Just type :
which -all ndsort
I guess this function is not on your path. You will get the same error by typing:
>>s = struct('type', {'big','little'}, 'color', {'red'}, ...
'x', {3 4})
>> madonna(s)
??? Undefined function or method 'madonna' for input arguments of type 'struct'.
  댓글 수: 1
Aurelien Queffurust
Aurelien Queffurust 2012년 1월 26일
http://www.mathworks.fr/support/tech-notes/1200/1207.html#17

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

추가 답변 (2개)

Rakshith Vishwanatha
Rakshith Vishwanatha 2020년 12월 10일
Posting this miscellaneous case of " input arguments of type 'struct' " error in case others find this useful:
In my case, I was runnnig my own local matlab scripts and the "lqrpilot" example code in matlab. The constant swapping between two paths, loading and clearing of workspace variables and matlab paths while working with these two code bases located in two different places seemed to have messed up the function path requirements of matlab. Due to this, I started getting " input arguments of type 'struct' " errors on my project/code base as well though it was not of primary use.
Closing and restarting MATLAB helped it reset all variables to default values and both code bases started to work again.

SAQR THABET
SAQR THABET 2019년 5월 7일
If this function is not on your m.file path then while you are editing your m.file simply open the folder of the desired funtion via the current folder tap, right click on the faded folder icon and select <add to path> whick will include all folders and subfolders. the folder icon will become bright, which means the folder path was added successfully.
You can test if the function is now defined or not using:
which -all function

카테고리

Help CenterFile Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by