Loopless function calls on vector/matrix members in Matlab/Octave

前端 未结 4 1632
走了就别回头了
走了就别回头了 2021-01-18 23:08

I came into matrix world from loop world (C, etc)

I would like to call a function on each individual member of a vector/matrix, and return the resulting vector/matri

4条回答
  •  天涯浪人
    2021-01-18 23:29

    Yes.

    function retval = newfun(v)
        retval = a*exp(-((v-b).^2)/(2*c*c));
    endfunction
    

提交回复
热议问题