How to do majority voting in matlab
显示 更早的评论
I want to do majority voting on the acquired max values from a matrix 200 by 100 in matlab and put it in 200 by 1 vector named max_index. I got the majority voting code from this link https://github.com/jsantarc/Majority-Vote-function-for-Matlab-/blob/master/majorityvote.m. I have put it in the same directory as other m files when i call the function by this line [ out ] = majorityvote(max_index), it gives me this error: Undefined function or variable 'majorityvote'. How can i solve this error?
回答(1 个)
John D'Errico
2017-4-25
0 个投票
What directory did you put it in? NEVER put m-files under the MATLAB root directories. Your m-files won't be seen, at least not until MATLAB is forced to recreate its cache.
2 个评论
Shelly
2017-4-25
Steven Lord
2017-4-26
What did you call the function file? Did you call it majorityvote.m?
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!