I have a defined a function (GetDepth) which does something fairly trivial, eg takes in a 2x4 matrix and outputs a 2x1 matrix. I then have an 2x4xn matrix I want to apply it to, and I'm expecting an 2x1xn matrix result.
What is the correct syntax to apply my function to the matrix without resorting to using a loop?
ed. As requested, here's an example of the thing I'm trying to do:
function [bidWSize, askWSize] = getWSizes(m, bookSizeHistory)
bidWSize = sum(bookSizeHistory(2:4, 1, m));
askWSize = sum(bookSizeHistory(2:4, 2, m));
end
Currently I'm then looping and feeding into a 2x1xn output