find the values of polynomial to use polyfit

3 ビュー (過去 30 日間)
Zeynep Toprak
Zeynep Toprak 2020 年 3 月 26 日
コメント済み: Zeynep Toprak 2020 年 3 月 28 日
By using the census population data, Show that the relationship results between t and the log of the population by setting . To find and , you use the code of polyfit,
where this data is fitted in the form of
So, let's define population as p
Since ,
And log of p is
load census
t = (cdate - 1790)/10;
lnp = @(c) log(c(2)) + c(3)*t;
polyfit( lnp, t)
I write this code to find c(2) and c(3). But this code does not work. I get error.

採用された回答

Cris LaPierre
Cris LaPierre 2020 年 3 月 26 日
With polyfit, you supply it the X and Y data and it returns the equation for you. Well, the coefficients of the polynomial of the order you specify. The error message you are getting is becaue you are trying to pass in an anonymous function for X.
  28 件のコメント
Zeynep Toprak
Zeynep Toprak 2020 年 3 月 27 日
wow, perfect thank you so much for your great effort!! You're the best! Take care! :)
Zeynep Toprak
Zeynep Toprak 2020 年 3 月 28 日
Hello professor again, yesterday, you explained this question perfectly. these are not assigments. since classes are closed down, on these leisure times, I try to improve my matlab skills by myself by following videos on youtube and solving some exercises. i have one more question. i solved it mostly. but at the end i need to solve two nonlinear equation simutanously. bu i could not here. Or can i do question with fminsearch ? My question is here if you 're going to help me one more, i will be glad. :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by