indexed list of fit objects?
4 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Konrad Malkowski
2011 年 8 月 3 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Parallel for-Loops (parfor) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!