convert for loop into parfor loop

1 visualización (últimos 30 días)
Lutetium
Lutetium el 17 de Nov. de 2020
Comentada: Rik el 17 de Nov. de 2020
Can somebody point out how I have to modify the code below to allow it being used in a parfor loop
H = height(RTImport)
location = 'location..'
ds = datastore(location)
TT = tall(ds)
func = @(x) mean(x,'omitnan');
x1{H} = {};
x2{H} = {};
tic
for i = 1:H
Strt = minutes(RTImport.Start(i))
endT = Strt + minutes(1)
S = timerange(Strt,endT,'closed')
TT1 = TT(S,:)
Strt = Strt + minutes(1)
endT = Strt + minutes(1)
S = timerange(Strt,endT,'closed')
TT2 = TT(S,:)
x1{i} = varfun(func,TT1,'OutputFormat','table')
x2{i} = varfun(func,TT2,'OutputFormat','table')
gather(x1{:},x2{:})
end
toc
I get the information unable to classify x1 in the body of the parfor. Going through the information, I couldnt really figure out what wrong with it...Appreciate any help
  6 comentarios
Lutetium
Lutetium el 17 de Nov. de 2020
Rik, thanks! I learnt a lot today. I appreciate your input!
Rik
Rik el 17 de Nov. de 2020
You're welcome.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Parallel for-Loops (parfor) en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by