running a file from inside a parfor loop
显示 更早的评论
I'm doing a parameter sweep on a transfer function which is constructed from a lenghty statement that I'm printing to a file from sympy, which calculates the transfer function based on workspace variables. Without parallel computing, I just use
run('Gcl_tf.m')
I've tried to read the file to a string and eval'ing it from the parfor loop, unfortunately eval doesn't seem to like parfor. I could find information on how to attach a file to a parallel pool, but I can't figure out how to execute a file from those attached files.
I could of course just copy the file contents into my script, that works, but the line is so long that MATLAB doesn't display it properly. And in case I update the file, I'd have to copy it again.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!