Wha'ts wrong with this?
古いコメントを表示
I'm very new and I can't detect what's wrong here. I would be very pleased if you could help me. Thanks!
syms x
f(x)=sin(x+1)*sqrt(x+1)
sym(polyfit([1,2,3,4],[f(1),f(2),f(3),f(4)],3))
Inputs must be floats, namely single or double.
採用された回答
その他の回答 (1 件)
Image Analyst
2020 年 11 月 28 日
1 投票
Like it says, x must be a double, not a sym. f is a sym since x was (I'm guessing since I don't have the Symbolic Toolbox.) So just don't define a at all, and don't put polyfit() into sym() either.
3 件のコメント
Car Ma
2020 年 11 月 28 日
Image Analyst
2020 年 11 月 28 日
Fine, but do it numerically, not symbolically, like Alan and I told you.
Car Ma
2020 年 11 月 28 日
カテゴリ
ヘルプ センター および File Exchange で Common Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!