linear regression matlab code

.

댓글 수: 7

Star Strider
Star Strider 2021년 12월 20일
The polyfit function and its friends could be helpful here.
Star Strider
Star Strider 2021년 12월 20일
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 2021년 12월 20일
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 2021년 12월 20일
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 2021년 12월 20일
편집: Walter Roberson 2021년 12월 20일
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 2021년 12월 20일
@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 2021년 12월 20일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2021년 12월 20일
편집: Image Analyst 2021년 12월 20일

1 개 추천

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

질문:

2021년 12월 20일

댓글:

2021년 12월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by