Home / Expert Answers / Computer Science / matlab-matlab-matlab-a-use-textscan-to-read-the-entire-text-file-videogamedata-txt-into-a-cell-a-pa218

(Solved): MATLAB MATLAB MATLAB a. Use textscan () to read the entire text file VideoGameData.txt into a Cell A ...



MATLAB MATLAB MATLAB
a. Use textscan () to read the entire text file VideoGameData.txt into a Cell Array videogamesInfo. Note that the size of the
@O> videoGamesInfo
b. Use the information from the Cell Array videoGamesInfo to create a new Structure Array called gameData
a. Use textscan () to read the entire text file VideoGameData.txt into a Cell Array videogamesInfo. Note that the size of the Cell Array videogamesInfo is \( 1 \times 5 \) so there are 5 cells in a single row. The first cell videogamesInfo \( \{1\} \) contains a Cell Array of size \( 5 \times 1 \) that has the game titles. The second cell videoGames \( \{2\} \) contains another Cell Array of size \( 5 \times 1 \) with the game protagonist, etc. @O> videoGamesInfo b. Use the information from the Cell Array videoGamesInfo to create a new Structure Array called gameData that has the following field names: title, protagcinist, antagonist, releaseYear, and MilCopiesSold. (Hint: use a for loop that goes through each game in videogamesInfo and extracts the necessary information to fill in the fields of the Structure Array gameData) c. Convert the Structure Array gameData to a table called gameTable using the built in function struct2table(). You may find struct2table from the online documentation helpful for using this function correctly. d. Update the metadata of gameTable so that ( Hint: Rewatch online learning video \( G .2,2 \) ) i. the property VariableUnits of the MilCopiessold column is set to ' \( \mathbf{M} \) ' ii. the property Description is set to 'Video Game Records'


We have an Answer from Expert

View Expert Answer

Expert Answer


The Matlab code clear all; close all; clc; % getting the filename filename = "VideoGameData.txt"; % opening the file fileID = fopen(filename); % scann
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe