Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Call read table command to read all the data in the worksheet called Paragould.

ID: 3773975 • Letter: C

Question

Call read table command to read all the data in the worksheet called Paragould. Read only the first two columns of data by specifying a range. Import the file as column vectors using the import tool and interactively plot Time vs. Temperature (degree F). Add proper axes and title to the plot. Import only the numeric data into a matrix, using xlsread command. Plot Time vs. Humidity and Time vs. Temperature (degree F). X-axis should be Time. Add proper axes, legend, and title to the plot. Call read table command to read all the data in the worksheet called Jonesboro. Read only the first two columns of data by specifying a range. Sort temperature in descending order in the table. Sort humidity in ascending order in the table. Import only the numeric data into a matrix, using xlsread from both worksheets, Jonesboro Paragould. Plot and compare time vs. humidity for both cities. X-axis should be Time Add axes, legend, and title to the plot.

Explanation / Answer

To read all data from work sheet with Paragould

T = readtable(‘worksheet.xlsx','Delimiter',' ','Paragould',false)

To Read only first two coloumns

1.     Open one of the files in the Import Tool.

2.     From the Import button, select Generate Function. The Import Tool generates code similar to the following excerpt, and opens the code in the Editor.

...

5.     Save the function.

6.     In a separate program file or at the command line, create a for loop to import data from each spreadsheet into a cell array named myData:

end

Each cell in myData contains an array of data from the corresponding worksheet. For example, myData{1} contains the data from the first file, myfile01.xlsx.

x = [2 5 8 2 11 3 6];

title('Plot for Time and Temperature')

xlabel('Time')

ylabel('Temperature’)

ts1 = timeseries(x,1:7);

ts1.TimeInfo.Units = 'days';

ts1.TimeInfo.StartDate = '01-Jan-2011';

ts1.TimeInfo.Format = 'mmm dd, yy';      

ts1.Time = ts1.Time - ts1.Time(1);       

plot(ts1)

x = [2 5 8 2 11 3 6];

title('Plot for Time and Humidity)

xlabel('Time')

ylabel(‘Humidity’)

ts1 = timeseries(x,1:7);

ts1.TimeInfo.Units = 'days';

ts1.TimeInfo.StartDate = '01-Jan-2011';

ts1.TimeInfo.Format = 'mmm dd, yy';      

ts1.Time = ts1.Time - ts1.Time(1);       

plot(ts1)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote