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

Printable View

• Nov 20th 2010, 03:02 AM
adam_leeds
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.

Thanks Adam

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:

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.

Thanks Adam

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
adam_leeds
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:

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

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

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