Filter löschen
Filter löschen

L-BFGS-B with function calculated by commercial software

3 Ansichten (letzte 30 Tage)
Nike Dattani
Nike Dattani am 11 Sep. 2017
Kommentiert: Nike Dattani am 31 Okt. 2017
When I search "L-BFGS-B matlab", I find way too many options to choose from. I run a commercial FORTRAN binary twice, and the difference between the two output numbers is what I want to optimize. Therefore I need MATLAB to call the commercial FORTRAN binary twice (via two separate input files), parse the output files for the relevant numbers, and feed the difference between these two numbers into an L-BFGS-B routine.
How would I go about solving this problem?
  4 Kommentare
Walter Roberson
Walter Roberson am 22 Sep. 2017
tfile = tempname();
fid = fopen(tfile, 'wt')
fprintf(fid, 'commands for\n')
fprintf(fid, 'program input go here\n');
fclose(fid)
cmd = sprintf('"%s" -i "%s"', 'C:\Some\Directory\NameOfCommercialProgram.exe', tfile );
[status, result] = system(cmd);
result_numeric = sscanf(result);
repeat for the second call but with different output variables, then call L-BFGS-B with the difference between the numeric results.
Nike Dattani
Nike Dattani am 31 Okt. 2017
Walter, I appreciate your answer VERY much. Unfortunately I did not get an email notification saying that you replied, but was expecting one, so I thought no one replied to this. I ended up convincing the developers of the commercial program to work on a BFGS routine intrinsic to their program, but if it takes to long or doesn't work out, I will come back to this.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Fortran with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by