What if you modify this matlab optimization example?

Hello
what if w2 is between 1 and 199 instead of 1-100? In that case wx and wy would have different sizes and it would throw an error at K1.

6 件のコメント

Richárd Tóth
Richárd Tóth 2019 年 8 月 5 日
you could modify s(1,1) to 1 so wx and wy will have a size of 100 at start, but as we know s is changing between calls, so they can have different sizes during the execution
Torsten
Torsten 2019 年 8 月 5 日
編集済み: Torsten 2019 年 8 月 5 日
w1x and w1y would have different sizes, but not wx and wy.
Richárd Tóth
Richárd Tóth 2019 年 8 月 5 日
編集済み: Richárd Tóth 2019 年 8 月 5 日
So the key is that wx and wy is created with meshgrid from w1x and w1y
Richárd Tóth
Richárd Tóth 2019 年 8 月 5 日
Can you create n dimensional semi infinite constraints too instead of two dimensional constraints by using ndgrid instead of meshgrid?
Richárd Tóth
Richárd Tóth 2019 年 8 月 5 日
the answer seems to be yes
Torsten
Torsten 2019 年 8 月 6 日
編集済み: Torsten 2019 年 8 月 6 日
yes. The number of elements created by meshgrid (or ndgrid) in the arrays wx and wy equals the number of grid points in two (or n) dimensions - and that's where the constraint is evaluated.

サインインしてコメントする。

回答 (0 件)

タグ

質問済み:

2019 年 8 月 5 日

編集済み:

2019 年 8 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by