bsxfun implementation in solving a min. optimization task

一笑奈何 提交于 2019-12-07 09:13:34

I believe you need this correction in your code -

[minindex_alongL2, minindex_alongL1] = ind2sub([size(L2,1) size(L1,1)],p)

For the solution, you need to add the size of p into the index finding in the last step as the vector whose min is calculated has the "added influence" of alpha -

[minindex_alongL2, minindex_alongL1,minindex_alongalpha] = ind2sub([size(L2,1) size(L1,1) numel(alpha)],p)

minindex_alongalpha might be of your interest.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!