College Matlab Program, xlsread, strcmp. Need help getting started! Already have some code

1 view (last 30 days)
clear all clc
FILENAME = 'gameResults2011.xls'; xlxexist = exist(FILENAME);
if xlxexist == 2
sheetName='Sheet1';
[numbers, strings, A] = xlsread(FILENAME, sheetName);
else fprintf('errorMsg'); end
Here is the assignment:
CONSTANT variables Save the name of the file in a CONSTANT variable name; use the variable name as the argument with the xlsread().
Input Read the Auburn 2011 season game results from gameResults2011.xls There are eight columns of data in the data file. Not all are numbers. 1 - SEC, 2 - Date, 3 - Away, 4 - Opponent, 4 - AU Score, 5 - Opp Score, 6 - Minutes, 7 - Attend Read the data into a numeric and a text matrix. Note the difference and relationship of the number of rows in the two matrixes. Your program should work for any number of games in the file. Use size obtain the number of games (rows) and columns.
Computation Find the longest game time. Game time = 3 hours + the fraction of an hour obtained from the minutes column. Find the largest game attendance. Find the largest win and loss point spread and the index of the game in which it occurred. (Point spread is the difference between the Auburn and opponent score.) NOTE: Your submitted file(s) MUST be spelled and cased as instructed.
New commands xlsread() cell array {} strcmp() Revisit exist() for loop size() fprintf() if..else max() with one & two outputs matrix element indexes CONSTANT variable
Output Refer to the Sample Output for the information that should be included in the report.
Include the titles and column headings. NOTE: the “as of” date should be obtained from the last game date in the spreadsheet.
MULTIPLE fprintf()s CAN BE USED TO PRINT ONE LINE.
Depending on whether Auburn wins or loses, print ‘W’ or ‘L’.
Print a flag ‘^’ next to the time equal to the largest time else print a space.
Print a flag ‘#’ next to the attendance equal to+ the largest attendance else print a space. Print a legend that indentifies the flags in the report. Print the largest win and loss point spread with the date and opponent of the game.
Printing Use fprintf for all output. Use two decimal places for time Print other numbers with no decimal places Column numbers right-justified, i.e., right-aligned Use %-20s to print the Opponents’ name. The negative sign will print the name left-justified.
I have to use the "new" commands as indicated above. I'm not asking for someone to write the entire program, I just need some direction.
What's confusing me the most is how to recombine the string and numeric outputs of xlsread. I would use the "RAW" data output, but NaN's are getting in the way.

Answers (0)

Categories

Find more on Strategy & Logic in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!