Matlab making new cell array from another cell array fileds -


i have cell array thiscells:

thiscells <1*40 cell> eacharray of thiscells 280*3 

i have function (thefunction) gets input of cell array each array x*2

how can send cell array thefunction contain columns1,3 each array?

i tried

thefunction(thiscells{:}(:,1:2)) % tring send columns 1,2 

but didn't work

edit:

working (but still looking faster way so):

what did far

thefunction(makingnewcells(thiscells,2)); 

when

makingnewcells: [newcells]=makingnewcells(oldcells) ii=1:max(size(oldcells))   newcells=oldcells(:,[1 column]); end 

this question , answers may of - thiscells{:}(:,1:2) failing without call thefunction, if not mistaken.

for cells, problem worse: add impossibility double-subref if did intended do, passes 40 arguments (which 280x2 vectors) thefunction. doubt there (m)any legitimate uses function takes 40 arguments of same type, instead of having wrapped in cell. try doc cellfun first.

edit: clear, suggest changing thefunction accepts cell of 40 matrices of size 280x2), using

cell_of_twocolumned_arrays = cellfun(@(x)x(:,[1 2]),thiscells) 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -