max function is missing in the @logical file on 'matlab' toolbox
이전 댓글 표시
Hello all,
I am facing a strange problem and I have not seen any possible solution for it on the web except a very loose and general solution which is re-installing a toolbox.
I am using the built-in max function in my code and matlab returns an error saying: Undefined function 'max' for input arguments of type 'struct'.
As you expected, I have surfed the web and applied EVERY possible and proposed solution but unfortunately nothing worked. I checked everything guys.
So, I typed: which max and it returns this:
built-in (C:\Program Files\MATLAB\R2013b\toolbox\matlab\datafun\@logical\max) % logical method
and I tracked this path and surprisingly I did not find the @logical file in this path!!
as a possible solution: I uninstalled and re-installed matlab again in a hope for the @logical file to be re-established but unfortunately the problem still persisting. I also updated the toolbox.
Note: My code was running WITH absolutely NO problem and it hasn't been modified at all. All files are in the directory and there is no path issues.
Summary of the problem:
1- @logical file is missing which belongs to 'matlab' toolbox (the toolbox name is matlab). 2- The toolbox of @logical is installed and its name is matlab. 3- My matlab version is R2013b.
답변 (1개)
per isakson
2014년 8월 31일
편집: per isakson
2014년 8월 31일
Firstly try
which max -all
which shows that there are max for many types of data, but not for struct.
Secondly, what do you expect that max(a_struct) should return?
"Note: My code was running WITH absolutely NO problem [...]"   Are you really sure that there isn't something else that causes the problem?
Could it be that some function, which used to return e.g a double array, now returns a struct?
댓글 수: 2
Tony
2014년 8월 31일
per isakson
2014년 8월 31일
편집: per isakson
2014년 8월 31일
I bet wav_index wasn't a struct when your code run in the previous release. With Matlab you cannot be sure.
wav_index, isn't that a strange name for a struct. "Index" indicates a vector of whole numbers.
How is wav_index assigned its value?
카테고리
도움말 센터 및 File Exchange에서 Performance and Memory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!