Borrar filtros
Borrar filtros

How to save "optimoptions" to a file?

1 visualización (últimos 30 días)
MByk
MByk el 14 de Sept. de 2020
Comentada: Star Strider el 14 de Sept. de 2020
Is there a way to save "optimoptions" to a txt file? I tried the code below but it is not working. I also tried "dlmwrite" and "writetable". Thanks for the help.
fid = fopen('GA_Results.txt','wt+');
fprintf(fid,'%s', GA_Opts);
fclose(fid);

Respuesta aceptada

Star Strider
Star Strider el 14 de Sept. de 2020
I have never tried that.
I would save it to a .mat file. Then load it when you need it.
  4 comentarios
MByk
MByk el 14 de Sept. de 2020
Editada: MByk el 14 de Sept. de 2020
That's exactly the same error I got but using "save" command and saving to a mat file works perfectly. You can save both variables (GA results and optimoptions) in one call. There is also an example with txt files in the document page, it is working but it is impossible to read the txt file.
save('GA_Results.mat','GA_Opts','GA_Results')
Star Strider
Star Strider el 14 de Sept. de 2020
Thank you!
For some problems .mat files are the only option.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by