Polynomial
2 ビュー (過去 30 日間)
古いコメントを表示
#How can I write a polynomial function in matlab that can take 3 inputs to predict a forth element?
Thanks
0 件のコメント
回答 (1 件)
Steven
2011 年 12 月 5 日
f = @(x,y,z)(x+y+z);
or
f = inline('x+y+z', 'x', 'y', 'z');
or
function f = myfun(x,y,z)
f = x+y+z;
return
give all
>> f(1,1,1) = 3
3 件のコメント
Steven
2011 年 12 月 5 日
you can write any function you want - I just showed you some basic examples - such as f = @(x,y,z)(2*x-4*y+pi*cos(z)). As I understand, you want to optimize your function, so you shold take a look at the optimization toolbox.
参考
カテゴリ
Help Center および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!