How to export the results of optimization by optimization toolbox to excel

2 ビュー (過去 30 日間)
Allwyn
Allwyn 2022 年 9 月 15 日
回答済み: Deep 2025 年 1 月 20 日
I am using ga in optimization toolbox to find the optimal operating power points of a hybrid renewable station consisting of PV, battery,fuel cell and diesel generator. Each 20 mins, MATLAB should read the contents of excel sheet based on which optimization will be done. The results of optimization are to be written to the excel at allotted columns, so that it can be read by a third software. Is it possible to read data for optimization from excel and to export the optimized results to excel using the optimization toolbox. Any suggestions will be valuable for my work.Thanks.

回答 (1 件)

Deep
Deep 2025 年 1 月 20 日
To handle Excel data in MATLAB, use the "readtable" function to import data and the "writetable" function to export results. For more details, see the documentation for "readtable" at https://www.mathworks.com/help/matlab/ref/readtable.html and "writetable" at https://www.mathworks.com/help/matlab/ref/writetable.html.
If you want to execute custom code during an optimization session, check out this example: https://www.mathworks.com/help/gads/custom-output-function-for-genetic-algorithm.html. It demonstrates using a custom output function in the genetic algorithm solver to set up and maintain a plot during iterations.

カテゴリ

Help Center および File ExchangeProblem-Based Optimization Setup についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by