Having trouble with a data set in MATLAB Programming

조회 수: 3 (최근 30일)
Andy
Andy 2012년 7월 21일
Hello,
I am trying to run an linear regression in MATLAB but I don't know how to program MATLAB that well. My data set is the following:
0 11.4
1 11.9
2 7.1
3 14.2
4 5.9
5 6.1
6 5.4
7 3.1
8 5.7
9 4.4
10 4.0
11 2.8
12 2.6
13 2.4
14 5.2
15 2.0
How do I get MATLAB to run a linear regression? Also, how do I import a text file (.txt) in MATLAB that contains the above data?

답변 (1개)

bym
bym 2012년 7월 21일
doc textread
doc polyfit
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 7월 22일
textscan() rather than textread(); textread() is being deleted.
importdata() might also read the file.

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

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by