Matlab Tools for Multiple Instruction Single Data (MISD)?
5 次查看(过去 30 天)
显示 更早的评论
Hello, I have a problem that has more than one million functions to evaluate, all different, for the same data group. Morphologically this type of problem is called MISD (Multiple Instructions Single Data), each mathematical function can be written as a matlab function, with input and output arguments. What is the most efficient way to solve this type of problems with matlab ?.
2 个评论
回答(1 个)
Walter Roberson
2017-5-8
global variables are the slowest kind of variables. You would be better to parameterize your functions
7 个评论
Walter Roberson
2017-5-9
If you have a vector of symbolic expressions, I would probably be tempted to factor() the length of the vector, reshape() with the last (largest) factor as the first dimension, then use matlabFunction on each column, asking to generate files. The purpose here is to batch enough work together to make it worth while to talk to a worker considering communications overhead.
If the expressions are to be reused multiple times, leave the default matlabFunction optimization on; otherwise, the optimization phase might be more expense than it is worth.
After that you can create workers, AddAttachedFiles, and parfeval() to invoke the functions on the current data.
Note: matlabFunction does not currently do well on vectors of functions where the components might require looping or piecewise(): in current implementations it tries put 'if' statements inside the horzcat or vertcat operator. matlabFunction also currently does not do well on int() with a vector of locations to be integrated.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!