Results 1 to 8 of 8

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

  1. #1
    Senior Member
    Joined
    Oct 2008
    Posts
    393

    Unhappy 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
    Last edited by adam_leeds; November 20th 2010 at 04:42 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by adam_leeds View Post
    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
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Senior Member
    Joined
    Oct 2008
    Posts
    393
    Quote Originally Posted by CaptainBlack View Post
    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
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by adam_leeds View Post
    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
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Senior Member
    Joined
    Oct 2008
    Posts
    393
    Quote Originally Posted by CaptainBlack View Post
    .. 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.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by adam_leeds View Post
    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
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Senior Member
    Joined
    Oct 2008
    Posts
    393
    Quote Originally Posted by CaptainBlack View Post
    Use the excel import tool

    CB
    Might sound stupid this lol but...

    Is this on excel or matlab?
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by adam_leeds View Post
    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
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. League tables
    Posted in the Advanced Statistics Forum
    Replies: 4
    Last Post: July 22nd 2011, 01:32 AM
  2. matlab for loop help.. NO idea where to start..
    Posted in the Math Software Forum
    Replies: 1
    Last Post: March 16th 2010, 08:20 PM
  3. Matlab how to make a table with infinite data
    Posted in the Math Software Forum
    Replies: 2
    Last Post: February 4th 2010, 05:07 AM
  4. [SOLVED] How to create a membership table for SETS?
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: October 25th 2008, 09:05 AM
  5. Writing a Program to Create a Table Based on Input
    Posted in the Calculators Forum
    Replies: 1
    Last Post: July 16th 2008, 01:34 AM

Search Tags


/mathhelpforum @mathhelpforum