Hi, I'm using cellfun to use one cell which contains indexes to index from another cell. My code is like this:
cellData = cell(1,2);
cellIndex = cell(1,2);
cellData{1} = [10:-1:1];
cellData{2} = [5:-1:1];
cellIndex{1} = [2,4,5];
cellIndex{2} = [2];
cellResult = cellfun(@(a,b) a(b), cellData, cellIndex, "UniformOutput", false)
And the result is this:
cellResult =
{
[1,1] =
9 7 6
[1,2] = 4
}
This is the correct result. My question is, is there a function available so that I can use cellfun without the anonymous function call? I've tried looking through the function index, but wasn't able to find anything. I want to avoid the anonymous function in order to try to speed the code up.