Borrar filtros
Borrar filtros

find the values of polynomial to use polyfit

2 visualizaciones (últimos 30 días)
Zeynep Toprak
Zeynep Toprak el 26 de Mzo. de 2020
Comentada: Zeynep Toprak el 28 de Mzo. de 2020
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.

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 26 de Mzo. de 2020
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 comentarios
Zeynep Toprak
Zeynep Toprak el 27 de Mzo. de 2020
wow, perfect thank you so much for your great effort!! You're the best! Take care! :)
Zeynep Toprak
Zeynep Toprak el 28 de Mzo. de 2020
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. :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by