Map function in MATLAB?

前端 未结 7 829
情书的邮戳
情书的邮戳 2020-11-29 17:11

I\'m a little surprised that MATLAB doesn\'t have a Map function, so I hacked one together myself since it\'s something I can\'t live without. Is there a better version out

7条回答
  •  粉色の甜心
    2020-11-29 18:08

    Vectorizing the solution as described in the previous answers is the probably the best solution for speed. Vectorizing is also very Matlaby and feels good.

    With that said Matlab does now have a Map container class.

    See http://www.mathworks.com/help/matlab/map-containers.html

提交回复
热议问题