indexed list of fit objects?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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!
0 Kommentare
Antworten (1)
Konrad Malkowski
am 3 Aug. 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
0 Kommentare
Siehe auch
Kategorien
Mehr zu Sparse Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!