i'm running parfor loop returns matrix different dimensions @ each iteration, need these matrices concatenated final result
example
t = [1 2 3 0 7 8 9 10] i compute each row maximal block should return
first row
[1 2 1 3] and second row
[7 8 9 7 9 10] my code is
parfor = 1:size(t,1) findmbl(data,t(i,:)); end where findmbl function returns blocks. problem how can concat results of iterations in 1 matrix
result should be
[1 2 0 1 3 0 7 8 9 7 9 10] note: 0 in row 1 , 2 padding
if know maximum size of result, easy do.
% guessing this, substitute realistic maximum possible size res=zeros(2*size(t,1),size(t,2)); parfor = 1:size(t,1) auxres=findmbl(data,t(i,:)); res([i*2-1,i*2],1:size(auxres,2))=auxres; end
Comments
Post a Comment