第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

用FUNCTION搞定,怎么定義多元的如:y=x1*x2/x3?

用FUNCTION搞定,怎么定義多元的如:y=x1*x2/x3?

MATLAB運用優(yōu)化工具解決問題時,怎么定義多元函數(shù)。一元的:function=文件名(x);y=2*x^2;..其中有要確定目標函數(shù)的么,用FUNCTION搞定,怎么定義多元的如:y=x1*x2/x3菜鳥求助,問題白癡,多多包涵
查看完整描述

1 回答

?
瀟瀟雨雨

TA貢獻1833條經(jīng)驗 獲得超4個贊

如果是多元函數(shù)的話,可以參考fminseach
Example 1

The Rosenbrock banana function is a classic test example for multidimensional minimization:
f=x(1)^2+a*x(2)^2; 目標函數(shù) 
The minimum is at (1,1) and has the value 0. The traditional starting point is (-1.2,1). The anonymous function shown here defines the function and returns a function handle called banana:
function f=myfun(x,a) 新建著這樣的M文件
banana = @(x)100*(x(2)-x(1)^2)^2+(1-x(1))^2;

Pass the function handle to fminsearch:

[x,fval] = fminsearch(banana,[-1.2, 1])  
用這樣的格式條用fminseach以及M函數(shù), 其中[-1.2,1]為優(yōu)化其實點

This produces 運行以后的結果

x =

1.0000 1.0000

fval = 這個是優(yōu)化點的函數(shù)值

8.1777e-010

This indicates that the minimizer was found to at least four decimal places with a value near zero.

查看完整回答
反對 回復 2023-04-25
  • 1 回答
  • 0 關注
  • 193 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號