I have a function that performs a lot of element wise operations and returns numerous output. An example is
A = myfun(B)
where A is [1xn] and B is [1xm]. I have to use this function numerous times in parallel. I would like to accelerate this function using a GPU and arrayfun. To do this, I would have to call
[A1,...,An] = arrayfun(myfun,B1,...,Bm); where each matrix has the same number of rows (assume j). However, in my case n=30, and I want to use the output of arrayfun after calling it. Is there a way to have arrayfun return A, where A is one matrix of size [jxn]? This would save me a lot of hassle of having to: 1. Code [A1,...,A30] = arrayfun(); 2. Collect the code A = [A1 ... A30];
Really this question is more about convenience (but I suspect creating 30 individual vectors as opposed to one matrix could also impose a performance penalty). Thank you for your help.