Using parfor with a structure
Mostrar comentarios más antiguos
Hi All. I have a qyucik question on the use of parfor and an structure:
A code I have runs perfectly with for loop as follows:
Ps=[100:3.447:1000];
Ps(end)=PU;
P_V=[];
for j=1:length(Ps)
Mstructure.p=Ps(j);
[V] =f(Mstructure);
P_V=[P_V; Ps(j) V];
end
Mstructure is a structure with sevral fields. I would like to only update one of the fileds of Mstructure within a loop. Function f uses the Mstructure and calculate V. When I change this to parfor there is an error that parfor cannot be used because the way that Mstrycture is defined.
Could you please help resolve this issue?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!