max function is missing in the @logical file on 'matlab' toolbox
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(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 个评论
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?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!