Help with assessing learners work
Hi All,
I am trying to assess students work for a reference solution below, but the problem is that when one thing is wrong, it is marking everything as wrong even though some elements of the learner’s code are correct. For example, say, UTM is correct but RREF is wrong, the assessment will also assess UTM as wrong. Is there a way I can fix this
function [AI UTM RREF INVA] = ROINVERSE(A)
%% Step 1: Matrix Validation
% Establish the Size of the Matrix [m n]
[m n] = size (A) ;
% Check if the Matrix is Square
if m~=n
error(‘Matrix Is Not Square’) ;
% Check Matrix For Singularity
elseif det(A) == 0
error(‘Matrix Is Not Invertible Since |A|=0’) ;
% Inform The User The Matrix Can Be Inverted
else
disp(‘The Matrix Is Invertible’) ;
end
%% Step 2: Augmented Matrix AI
AI = [A eye(m)] ;
%% Step 3: Upper Triangular Matrix UTM
UTM = AI ;
for i = 1:m
% Making All The Pivots = 1
UTM(i,:) = UTM(i,:)./UTM(i,i)
for j = i+1:n
% Making Values Below Pivots Equal to Zero
UTM(j,:) = UTM(j,:)-UTM(j,i)*UTM(i,:)
end
end
%% Step 4: Reduced Row Echelon Form RREF
RREF = UTM ;
for k = 1:(m-1)
for l = k+1:n
RREF(k,:) = RREF(k,:)-RREF(k,l)*RREF(l,:)
end
end
%% Step 5: Extract The Inverse Matrix INVA
INVA = RREF(1:m,(n+1):end)
endHi All,
I am trying to assess students work for a reference solution below, but the problem is that when one thing is wrong, it is marking everything as wrong even though some elements of the learner’s code are correct. For example, say, UTM is correct but RREF is wrong, the assessment will also assess UTM as wrong. Is there a way I can fix this
function [AI UTM RREF INVA] = ROINVERSE(A)
%% Step 1: Matrix Validation
% Establish the Size of the Matrix [m n]
[m n] = size (A) ;
% Check if the Matrix is Square
if m~=n
error(‘Matrix Is Not Square’) ;
% Check Matrix For Singularity
elseif det(A) == 0
error(‘Matrix Is Not Invertible Since |A|=0’) ;
% Inform The User The Matrix Can Be Inverted
else
disp(‘The Matrix Is Invertible’) ;
end
%% Step 2: Augmented Matrix AI
AI = [A eye(m)] ;
%% Step 3: Upper Triangular Matrix UTM
UTM = AI ;
for i = 1:m
% Making All The Pivots = 1
UTM(i,:) = UTM(i,:)./UTM(i,i)
for j = i+1:n
% Making Values Below Pivots Equal to Zero
UTM(j,:) = UTM(j,:)-UTM(j,i)*UTM(i,:)
end
end
%% Step 4: Reduced Row Echelon Form RREF
RREF = UTM ;
for k = 1:(m-1)
for l = k+1:n
RREF(k,:) = RREF(k,:)-RREF(k,l)*RREF(l,:)
end
end
%% Step 5: Extract The Inverse Matrix INVA
INVA = RREF(1:m,(n+1):end)
end Hi All,
I am trying to assess students work for a reference solution below, but the problem is that when one thing is wrong, it is marking everything as wrong even though some elements of the learner’s code are correct. For example, say, UTM is correct but RREF is wrong, the assessment will also assess UTM as wrong. Is there a way I can fix this
function [AI UTM RREF INVA] = ROINVERSE(A)
%% Step 1: Matrix Validation
% Establish the Size of the Matrix [m n]
[m n] = size (A) ;
% Check if the Matrix is Square
if m~=n
error(‘Matrix Is Not Square’) ;
% Check Matrix For Singularity
elseif det(A) == 0
error(‘Matrix Is Not Invertible Since |A|=0’) ;
% Inform The User The Matrix Can Be Inverted
else
disp(‘The Matrix Is Invertible’) ;
end
%% Step 2: Augmented Matrix AI
AI = [A eye(m)] ;
%% Step 3: Upper Triangular Matrix UTM
UTM = AI ;
for i = 1:m
% Making All The Pivots = 1
UTM(i,:) = UTM(i,:)./UTM(i,i)
for j = i+1:n
% Making Values Below Pivots Equal to Zero
UTM(j,:) = UTM(j,:)-UTM(j,i)*UTM(i,:)
end
end
%% Step 4: Reduced Row Echelon Form RREF
RREF = UTM ;
for k = 1:(m-1)
for l = k+1:n
RREF(k,:) = RREF(k,:)-RREF(k,l)*RREF(l,:)
end
end
%% Step 5: Extract The Inverse Matrix INVA
INVA = RREF(1:m,(n+1):end)
end matlab grader, assessments MATLAB Answers — New Questions