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

• Nov 20th 2010, 03:02 AM
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
• Nov 20th 2010, 09:23 AM
CaptainBlack
Quote:

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
• Nov 20th 2010, 12:07 PM
Quote:

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
• Nov 20th 2010, 08:03 PM
CaptainBlack
Quote:

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
• Nov 21st 2010, 02:29 AM
Quote:

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.
• Nov 21st 2010, 05:09 AM
CaptainBlack
Quote:

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
• Nov 21st 2010, 06:34 AM
Quote:

Originally Posted by CaptainBlack
Use the excel import tool

CB

Might sound stupid this lol but...

Is this on excel or matlab?
• Nov 21st 2010, 07:15 AM
CaptainBlack
Quote: