- 'fopen' function: https://www.mathworks.com/help/matlab/ref/fopen.html
- 'fwrite' function: https://www.mathworks.com/help/matlab/ref/fwrite.html
How to create batch mode between matlab and optistruct? If I want to change some variables such as young's modulus for optimization how do I do it?
조회 수: 7 (최근 30일)
이전 댓글 표시
I would like to change the design variables for optimization through Matlab as the master. How do I read, write and export file after solving using optistruct?
댓글 수: 0
답변 (1개)
Balavignesh
2024년 1월 11일
Hi Adeline,
Here is a general workflow to change design variables for optimization in MATLAB and use it to control and interact with OptiStruct:
I would suggest you read the input file() that contains the design variables for OptiStruct using functions like 'fopen', 'textscan', or 'fread'. You could then parse the contents and modify the design variables as needed. After modifying the design variables, you will need to write the changes back to an input file that OptiStruct can read using 'fprintf', or 'fwrite'.
Run 'OptiStruct' from MATLAB using the 'system' command to execute the OptiStruct command line and export the results. You can read these files into MATLAB using appropriate file reading functions, depending on the file format (e.g., CSV, binary, etc.).
Kindly refer to the following documentation links to have more information on the following functions:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Low-Level File I/O에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!