linear regression matlab code
Mostrar comentarios más antiguos
.
7 comentarios
Star Strider
el 20 de Dic. de 2021
Star Strider
el 20 de Dic. de 2021
Please carefully read the documentation page I linked to, then try again!
It is neither appropriate nor desirable to expect the MATLAB Answers contributors to solve homework problems.
In polite society, this is known as cheating and is never appropriate.
.
Rik
el 20 de Dic. de 2021
Do you see the irony of asking for help and then commenting 'please don't tell me what to do'?
The Matlab documentation is really good. It is actually very good advice to direct you to it.
If you respond with 'it failed', the only advice people can give you is: do something different.
The documentation contains examples. Did you try to adapt them to your data?
You can find guidelines for posting homework on this forum here. If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks). If your main issue is with understanding the underlying concept, you may consider re-reading the material you teacher provided and ask them for further clarification.
Rik
el 20 de Dic. de 2021
The original tags ("matlab code", "matlab compiler", "matlab", and "code") were replaced by "homework", "polyfit", "regression" and "I do not like help documentation", and the release (R2021b) was removed.
Additionally, the name of the OP was changed, I suspect in order to avoid their teacher finding this thread.
Original question:
linear regression matlab code
how can i write a matlab code with 2 datas and years. I want to make matlab code with linear regression. we have to plot this code
my datas: x=[128.46 125.90 123.90 121.96 117.89 114.89 110.41 107.47 105.59 103.45 101.79 99.66 97.53 94.91 93.45 93.14 91.98 90.11] for world
y=[132.20 126.23 121.04 117.65 113.95 114.40 113.66 111.01 108.84 111.25 110.24 107.92 105.45 103.43 101.01 96.98 92.53 89.08] for turkey
years=between 2000-2017
Eeee Yyyy
el 20 de Dic. de 2021
Editada: Walter Roberson
el 20 de Dic. de 2021
Image Analyst
el 20 de Dic. de 2021
@Eeee Yyyy, well that really backfired on you. What you said reflects way more badly on you than on Rik and Star who've shown themselves over many years to be honorable, polite, and helpful. That may be the last question anyone ever answers from you.
Eeee Yyyy
el 20 de Dic. de 2021
Respuestas (1)
Image Analyst
el 20 de Dic. de 2021
Editada: Image Analyst
el 20 de Dic. de 2021
1 voto
See my attached polyfit demo. Adapt as needed.

1 comentario
Eeee Yyyy
el 20 de Dic. de 2021
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!