Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The expected outcome is a vector that returns S = [ 7, 8, -10, -5 ]\' in a win-l

ID: 3908454 • Letter: T

Question

The expected outcome is a vector that returns S = [ 7, 8, -10, -5 ]' in a win-loss program. Matrix G is described as the first 2 columns are the different game play for teams and the last 2 columns are the respected scores of the game. We first will find the correct adgancey matrix. S is the dominance factor of each game on a 1, 0, -1 win-loss scale (0 given for game against itself) and divided by the number of games (3)

Write a function that computes the net points vector S for a given set of games Your Function function s net wins (G,n teams) % computes the net wins vector s for a set of games % initialize s vector s zeros (n_teams, 1); % YOUR CODE HERE end Code to call your function in teams 4; 2G I1, 2, 5, 10; 1, 4, 57, 45; 2, 4, 3, 10 1; yi net_wins (G,n teams)

Explanation / Answer

the function is

function s=net_wins(G,n_teams)

s=zeros(n_teams,1)
for i=1:n_teams
a=G{i,1};
b=G{i,2};
c=G{i,3};
d=G{i,4};
s(a,1)=s(a,1)+c-d
s(b,1)=s(b,1)+d-c
end
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote