Calling variables into objective function

조회 수: 3 (최근 30일)
ew1124
ew1124 2019년 7월 5일
답변: Matt J 2019년 7월 5일
I want to use the optimization toolbox with a vectorized objective function. The objective function will be vector and matrix multiplication. I have the matrices that should be used, but they are 18x18. I also want to run a variety of different tests using different matrices. What is the best way to do this? I think I will have to just set up the matrix in each version of the objective function. It would be nice for there to be a way to read an excel file in the main optimization m file, and call the variable into the supporting functions, but I don't think there is, right?

답변 (1개)

Matt J
Matt J 2019년 7월 5일
There is, but the far better way is to use anonymous or nested functions, as covered here

카테고리

Help CenterFile Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by