
Rides Counting and Organizing Script
During my free time while working as a rides technician I thought it would be interesting to keep track of all the theme park and amusement park rides I have ridden over the past few years. I began keeping track of all the rides I rode starting April 2019 and wanted to make some tables and charts to track what I ride the most and how my ride preferences have changed over the years. This began by creating a table of raw data in Excel of all the rides I have ridden. I made one table for every year, creating 3 years of raw data tables. This can easily be expanded to add data for future years by duplicating and editing a previous year’s Excel table.
​
My initial thought was to make a table in Excel that would combine the data from all year tables and to use this to create a bar graph of ride counts for every attraction and every year. I tried doing this with normal Excel tables and quickly found that the master table would not update when I added rides to the most recent year. One idea I had to overcome this was to use a pivot table on the overall data table’s page, but I did not have enough knowledge of these pivot tables and ran into issues. So, I decided to create a MATLAB script to perform the same data analysis. Now that this script is complete, I would like to go back and learn how to use pivot tables to perform the same analysis.
​
​
Function of the Program:
​
The MATLAB script begins by loading in data from all individual year ride data Excel tables. Erroneous information from the spreadsheet is removed so the imported data contains only ride name for each ride experience. Each year’s data is converted into a cell array and two vectors are made from each year’s data: one with ride names (a list of the names of every ride that was ridden for the specific year) and a second with ride counts (number of times the ride was ridden in a given year). These two vectors are then combined into a matrix (different format than is inputted) which is later exported to an Excel spreadsheet. Unnecessary variables used in the program are then cleared to simplify the MATLAB workspace should these counts be necessary.
Next, data from all years is combined in MATLAB to make an overall rides list and ride experience count list. The list is sorted by quantity of rides and exported into the final Excel spreadsheet. A table of ride names and ride counts is written to Excel for each year as well as for an overall count list, each with its own tab in the same Excel workbook.
​
​
Fine Tuning the Program:
​
Once the program was functional I went back to simplify the program, remove unnecessary commands, and improve the overall efficiency of the program. I felt this was necessary because running the park rides script on my laptop would take almost a minute. Since I take my laptop with me on trips to amusement and theme parks outside of Florida I wanted the program to run quickly after I update my data tables after a long day at a park so I can see updated plots and share this information with friends and others on these trips.
​
The first update I made was removing the code to generate plots of the overall ride counts in MATLAB. These plots were generated at the end of the script from the organized data generated during above lines of code. I found this was time consuming and multiple lines of code were necessary to organize the ride count data for the bar graphs to display in an increasing order. Ride name labels were also displaying improperly as bar graphs in MATLAB with over 20-30 bars do not line up with specific bars when zooming into the data to view individual ride names. As such, the simpler solution was to remove those lines and create a similar table in Excel which can be displayed on a whole page so all ride names can be easily read.
Next, I added a line to clear all variables which were not useful in analyzing the newly organized ride count data. This keeps the MATLAB workspace organized and allows for quick lookup of individual year or overall ride counts without opening Excel should a quick data table check be required. Since it does not add any appreciable run time to the script, I felt its addition was justified.
While looking over the final ride count data tables generated, I realized that I had many spelling and naming errors in my inputted data. For example, some ride names were misspelled (Maku instead of Mako, adding an extra ride to the list and making the overall count wrong) and some names appeared both as abbreviated and full ride names (“Dragster” and “Top Thrill Dragster” in the same table). The last two lines of this script create an alphabetical ride name list that is designed to help users quickly check their data for the issues.
There were a few locations in the program where I thought the row vectors being sorted needed to be made into column vectors, which was accomplished through transposing the vector and undoing the transpose at a later step. After successfully running the program without these vector transposes, they were removed from the code.
Initially I thought the user would be required to input the number of rides experienced per year to define bounds on the Excel data being imported. I found a quicker way to import the Excel data which does not require bounds on the data, and I know what rows need to be deleted from the raw data tables I created. This allowed me to remove many lines of code at the beginning of the script which would ask the user how many rides were logged during each year being analyzed.
Once the program was running properly I realized there were issues with importing data sets from the Excel worksheets into MATLAB. One year was not bringing 20 rides in, and another was not bringing in 41 rides. After adjusting the table formatting in the worksheet I realized that there were cells outside of the table filled in with notes which likely caused the issue when importing data to MATLAB.
At this point the MATLAB program was complete and ran with no issues. Further modifications were made to the ride count Excel spreadsheet to update the appearance and legibility of all plots and tables generated.
​
​
Future Steps:
​
Now that the program gives an accurate count of total number of recorded rides per attraction I would like to add in the ability to show how many times I rode each attraction in specific seats. For example - how many times have I ridden Mako in row 7 seat 4? I believe the best way to generate these plots is to make a matrix (auto-populated with zeros) in excel for each ride with a size equal to the size of each rides train. Then the program will add one to to the matrix index where I rode each time. This will require many more data to be processed in the program, and methods of reducing computation requirements will be tested once the feature has been created. ​


