Thread: Matlab help don't know where to start :( create a football league table

1. Matlab help don't know where to start :( create a football league table

Basically I have all the results from last season in excel.

And i want to work out the upsets.

So i need to somehow input the results into matlab which will put the results in match by match, whilst also comparing if a team with lower points beat the one it played.

My rubbish attempt with loads of errors:

footballLeagueTables('HomeTeam','AwayTeam',x,y)

a=[x];
b = [y];

for a = 1:1:n && b = 1:1:n
if a > b
HomeTeam + 3
AwayTeam + 3
elseif a == b
HomeTeam + 1
AwayTeam + 1
else
HomeTeam + 0
AwayTeam + 3
end
end

if HomeTeam < AwayTeam && a > b
+1
elseif HomeTeam < AwayTeam && a = b
+0
elseif HomeTeam < AwayTeam && a < b
+0
elseif HomeTeam = AwayTeam && a > b
+1
elseif HomeTeam = AwayTeam && a = b
+0
elseif HomeTeam = AwayTeam && a < b
+1
elseif HomeTeam > AwayTeam && a > b
+0
elseif HomeTeam > AwayTeam && a = b
+0
elseif HomeTeam > AwayTeam && a < b
+1
end

2. Originally Posted by adam_leeds
Basically I have all the results from last season in excel.

And i want to work out the upsets.

So i need to somehow input the results into matlab which will put the results in match by match, whilst also comparing if a team with lower points beat the one it played.

My rubbish attempt with loads of errors:

footballLeagueTables('HomeTeam','AwayTeam',x,y)

a=[x];
b = [y];

for a = 1:1:n && b = 1:1:n
if a > b
HomeTeam + 3
AwayTeam + 3
elseif a == b
HomeTeam + 1
AwayTeam + 1
else
HomeTeam + 0
AwayTeam + 3
end
end

if HomeTeam < AwayTeam && a > b
+1
elseif HomeTeam < AwayTeam && a = b
+0
elseif HomeTeam < AwayTeam && a < b
+0
elseif HomeTeam = AwayTeam && a > b
+1
elseif HomeTeam = AwayTeam && a = b
+0
elseif HomeTeam = AwayTeam && a < b
+1
elseif HomeTeam > AwayTeam && a > b
+0
elseif HomeTeam > AwayTeam && a = b
+0
elseif HomeTeam > AwayTeam && a < b
+1
end
What is the format of the Excel file?

CB

3. Originally Posted by CaptainBlack
What is the format of the Excel file?

CB
Not sure, but this is where i am getting the files from

England Football Results Betting Odds | Premiership Results & Betting Odds

4. Originally Posted by adam_leeds
Not sure, but this is where i am getting the files from

England Football Results Betting Odds | Premiership Results & Betting Odds
.. and how are you reading this data into Matlab

CB

5. Originally Posted by CaptainBlack
.. and how are you reading this data into Matlab

CB
I was trying to create variables into my script that could take strings for the football team names. But i failed.

6. Originally Posted by adam_leeds
I was trying to create variables into my script that could take strings for the football team names. But i failed.
Use the excel import tool

CB

7. Originally Posted by CaptainBlack
Use the excel import tool

CB
Might sound stupid this lol but...

Is this on excel or matlab?

8. Originally Posted by adam_leeds
Might sound stupid this lol but...

Is this on excel or matlab?
Matlab, it is probably on the file menu, or somewhere near. It will allow you to import selected columns from the spreadsheet into an array (possibly a cell array if some of the columns contain text, not tried that so I don't know).

CB

,

,

make football matlab

Click on a term to search for related topics.