Please answer in matlab code. Analyze hurricane data over 2001-2014 and 2015-2020 time periods. The data are provided in 2 csv files containing years and number of hurricanes for each year in sequential order, i.e.,: 2001 4 2002 6 ... (Year1 Num1 Year2 Num2 ...) Download the 2 csv files AtlanticHurricanes20012014_2.csv and AtlanticHurricanes20152020_2.csv and place them in the same folder with your mlx-file clear clc % read 2 csv files into 2 arrays hurr1 and hurr2 hurr1 = csvread('AtlanticHurricanes20012014.csv'); hurr2 = csvread('AtlanticHurricanes20152021.csv'); 1.Determine and print using "fprintf" the number of years in each of the two arrays. Using "reshape" and "transpose" functions, reshape the two arrays into 2-column arrays where the first column is the year number, and the second column is the corresponding number of hurricanes for that year. Combine the two 2-column arrays into a new single 2-column array hurrAll, The array hurrAll is then written into an Excel file using the writematrix command given below writematrix(hurrAll,'AtlanticHurricanes20012020.csv') Print the combined array hurrAll using the "disp" function (print headings for each column first) Sort the combined array hurrAll row-by-row (using the function sortrows) based on the number of hurricanes in ascending order and print the array using disp function. Using "find" function, find the years with minimum and maximum numbers of hurricanes. Print these years and respective hurricane numbers combined with explanatory text using "fprintf" function. Create an array that contains the years where the number of hurricanes was less or equal than 4 or larger or equal than 9. The array should be a column array with years as the first column and number of hurricanes as the second column. Sort the array by ascending number of hurricanes and use the disp function to display the results.
Please answer in matlab code.
Analyze hurricane data over 2001-2014 and 2015-2020 time periods. The data are provided in 2 csv files containing years and number of hurricanes for each year in sequential order, i.e.,: 2001 4 2002 6 ... (Year1 Num1 Year2 Num2 ...)
Download the 2 csv files AtlanticHurricanes20012014_2.csv and AtlanticHurricanes20152020_2.csv and place them in the same folder with your mlx-file
clear
clc
% read 2 csv files into 2 arrays hurr1 and hurr2
hurr1 = csvread('AtlanticHurricanes20012014.csv');
hurr2 = csvread('AtlanticHurricanes20152021.csv');
1.Determine and print using "fprintf" the number of years in each of the two arrays.
Using "reshape" and "transpose" functions, reshape the two arrays into 2-column arrays where the first column is the year number, and the second column is the corresponding number of hurricanes for that year.
Combine the two 2-column arrays into a new single 2-column array hurrAll,
The array hurrAll is then written into an Excel file using the writematrix command given below
writematrix(hurrAll,'AtlanticHurricanes20012020.csv')
Print the combined array hurrAll using the "disp" function (print headings for each column first)
Sort the combined array hurrAll row-by-row (using the function sortrows) based on the number of hurricanes in ascending order and print the array using disp function.
Using "find" function, find the years with minimum and maximum numbers of hurricanes. Print these years and respective hurricane numbers combined with explanatory text using "fprintf" function.
Create an array that contains the years where the number of hurricanes was less or equal than 4 or larger or equal than 9. The array should be a column array with years as the first column and number of hurricanes as the second column. Sort the array by ascending number of hurricanes and use the disp function to display the results.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images