| ²é¿´: 170 | »Ø¸´: 0 | |||
| µ±Ç°Ö÷ÌâÒѾ´æµµ¡£ | |||
compilerгæ (СÓÐÃûÆø)
|
[½»Á÷]
¡¾Òѽâ¾ö¡¿Çó½ÌÒ»¸ö¹ØÓÚfminconµÄÈõÎÊÌâ
|
||
|
ĿǰҪ×ö¹ØÓÚÓÅ»¯µÄÎÊÌ⣬ºÍfminconº¯ÊýʹÓÃÓйأ¬µ«ÊDz»¹ÜÎÒÔËÐÐhelpÀïÃæµÄÀý×Ó£¬»¹ÊÇÍøÉÏÕÒµÄÀý×Ó£¬ÔËÐж¼Ê§°Ü£¬Çë´ïÈ˰ïæָµãһϰɣ¬·Ç³£¸Ðл¡£ ±ÈÈçhelpÀïµÄÀý×Ó£º function f = myfun(x,a) f = x(1)^2 + a*x(2)^2; and function [c,ceq] = mycon(x,b) c = b/x(1) - x(2); ceq = []; To optimize for specific values of A and B, first assign the values to the se two parameters. Then create two one-argument anonymous functions that capt ure the values of A and B, and call MYFUN and MYCON with two arguments. Finall y, pass these anonymous functions to FMINCON: a = 2; b = 1.5; % define parameters first x = fmincon(@(x)myfun(x,a),[1;2],[],[],[],[],[],[],@(x)mycon(x,b)) Çë¸ßÊÖÔËÐÐһϣ¬¿´ÊÇ·ñÄܳɹ¦£¬Ö¸µ¼Ò»Ï°ɣ¡ =================================================== ÔÀ´ÊÇÎÒµÄÈí¼þÎÊÌâ£¬ÖØ×°Ò»Ï¾ͽâ¾öÁË¡£ [ Last edited by compiler on 2010-4-9 at 07:28 ] |
» ²ÂÄãϲ»¶
ÉúÎïѧѧ˶£¬Ò»Ö¾Ô¸ºþÄÏ´óѧ£¬³õÊԳɼ¨338
ÒѾÓÐ5È˻ظ´
332Çóµ÷¼Á
ÒѾÓÐ3È˻ظ´
343Çóµ÷¼Á
ÒѾÓÐ3È˻ظ´
ѧ˶274Çóµ÷¼Á
ÒѾÓÐ8È˻ظ´
ѹ¹ú¼ÒÒ»ÇøÏߣ¬Çóµ¼Ê¦ÊÕÁô£¬Óж÷±ØÐ»£¡
ÒѾÓÐ7È˻ظ´
081200-11408-276ѧ˶Çóµ÷¼Á
ÒѾÓÐ4È˻ظ´
22408 359·Öµ÷¼Á
ÒѾÓÐ4È˻ظ´
±¾¿ÆÐÂÄÜÔ´¿ÆÑ§Ó빤³Ì£¬Ò»Ö¾Ô¸»ªÀíÄܶ¯285Çóµ÷¼Á
ÒѾÓÐ5È˻ظ´
Ò»Ö¾Ô¸»ª±±µçÁ¦´óѧÄܶ¯×¨Ë¶£¬293£¬Çóµ÷¼Á
ÒѾÓÐ5È˻ظ´
µ÷¼Á310
ÒѾÓÐ7È˻ظ´















»Ø¸´´ËÂ¥