running a file from inside a parfor loop
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!