indexed list of fit objects?

3 vues (au cours des 30 derniers jours)
Craig
Craig le 22 Juil 2011
Guys - I've been beating my head on this for a couple of days & need help. I have a long series of sfit objects from fitting a database, and I need to store these objects in an indexed list so I can refer to them explicitly in an feval call inside a parfor loop. The serial code constructs a string for the name of the sfit object with the index imbeded in the name, and then uses eval to insert this name into the command line; obviously, this violates transparency. I've tried building a cell array for the objects, but what appears to be stored in the cells is just one of the coeffients of the sfit.
Any suggestions? Thanks!

Réponses (1)

Konrad Malkowski
Konrad Malkowski le 3 Août 2011
Have you tried placing the body of the parfor loop into a function?
For example, instead of:
parfor i = 1:10
y(i) = x(i) * 10;
end
use:
parfor i = 1:10
y(i) = foo(i, x);
end
function y = foo(i, x);
y = x(i) * 10;
end

Catégories

En savoir plus sur Fit Postprocessing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by