linear regression matlab code

.

7 commentaires

Star Strider
Star Strider le 20 Déc 2021
The polyfit function and its friends could be helpful here.
Star Strider
Star Strider le 20 Déc 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
Rik le 20 Déc 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
Rik le 20 Déc 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
Eeee Yyyy le 20 Déc 2021
Modifié(e) : Walter Roberson le 20 Déc 2021
These are the data I found. The teacher did not give such an assignment.
I asked for help with the my problem we did as a group.
Image Analyst
Image Analyst le 20 Déc 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
Eeee Yyyy le 20 Déc 2021
He says you are cheating on me. I don't even know how things go here. I've been struggling for weeks for this code because I'm new to matlab. threatens me with the teacher seeing me. I have no more enthusiasm. Sorry if I was rude. but when I get help from the site for the first time, instead of throwing the site with the rules directly, he says it's cheating. how can i know this? you can delete your answer, but I thank you anyway.

Connectez-vous pour commenter.

Réponses (1)

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange

Produits

Question posée :

le 20 Déc 2021

Commenté :

le 20 Déc 2021

Community Treasure Hunt

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

Start Hunting!

Translated by