Question: I need someone to look at mycode and help me figure this problem out. IT NEEDS DONE ASAP BC THE DUE DATE IS SOON. Here

I need someone to look at mycode and help me figure this problem out. IT NEEDS DONE ASAP BC THE DUE DATE IS SOON. Here is my code, the problem is attached as a file. Test 1
Code did not compile.
filename = 'example1.xlsx'
columnCheck = 'Name'
Test 2
Code did not compile.
filename = 'example2.xlsx'
columnCheck = 'Horse Color'
Test 3
Code did not compile.
filename = 'example3.xlsx'
columnCheck = 'Age'
Test 4
Code did not compile.
filename = 'example1.xlsx'
columnCheck = 'Draw Time'
function tryout = cowboyTryouts(file, header)
data = readtable(file);
%delete cowboys with gray horses
data(strcmpi(data{'Horse color'}, 'gray'), :) =[];
%creating 'Stats' column
data.Stats = round(data{:, 'Lasso Time'}./ data{:, 'Draw Time'},2);
% Extract the column for sorting
section = data{:, header};
% finding if double or char
check = class(section);
%whether number or character
if strcmp(check, 'double')
%descending
[~, sortIdx]= sort(section, 'descend');
else
%ascending
[~, sortIdx]= sort(section);
% Reverse
sortIdx = sortIdx(end:-1:1);
end
data = data(sortIdx, :);
data.(header)=[];
tryout = table2cell(data);
end
I need someone to look at mycode and help me

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!