How to convert string to optimization variable?

2 views (last 30 days)
Ephraim Bryski
Ephraim Bryski on 12 Jun 2022
Commented: Ephraim Bryski on 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 Comment
Ephraim Bryski
Ephraim Bryski on 18 Jun 2022
I ended up using "eval" function to solve this issue, but I know "eval" is not recommended.

Sign in to comment.

Answers (0)

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by