How to convert string to optimization variable?

3 Ansichten (letzte 30 Tage)
Ephraim Bryski
Ephraim Bryski am 12 Jun. 2022
Kommentiert: Ephraim Bryski am 18 Jun. 2022
I'm doing constrained optimization problems using the "problem based optimization workflow". I'm using a set of equations which have been constructed through string concatenation as the optimizaton variables. I now need to convert these strings to optimvars. It's simple to convert these strings to symbolic variables (just use str2sym), but I can't find anything anologous for optimvars. Any ideas on how to do this?
  1 Kommentar
Ephraim Bryski
Ephraim Bryski am 18 Jun. 2022
I ended up using "eval" function to solve this issue, but I know "eval" is not recommended.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by