I am doing optimization problem. The objective function requires to call external program. But time for calling the program (0.1s) is much longer than the analysis of external program itself (0.01s). The optimization needs thousands of iteration to find optimum solution, so this takes hours. Is there a way to shorten the time for calling external program as it consumes most of required time?
Example of my script:
x = ga(@fun,100);
function y = fun(x)
out = fscanf(fopen('output.tcl','r'),'%f',[100 Inf]);
y = fun2(out);