How can I apply a function to every row/column of a matrix in MATLAB?
You can apply a function to every item in a vector by saying, for example, v + 1
, or you can use the function arrayfun
. How can I do it for every row/column of a matrix without using a for loop?