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

Write a complete MATLAB program to perform the following using arrays: Prompt th

ID: 3527897 • Letter: W

Question

Write a complete MATLAB program to perform the following using arrays: Prompt the user to enter the number of US Air Force bases for which wind energy statistics are to be computed. Read the number of Air Force bases from the keyboard. (Wind speed information for the Air Force bases is given in a table on the next page.) Use a for-loop to perform the following repetitively: 1. Prompt the user to enter the name of the Air Force base as a text string and input the string in the cell array (name). Then prompt the user to enter the corresponding 12 values of wind speed for the months January through December as a vector (windspeed). 2. Compute the following wind energy statistics using MATLAB functions and store them in vectors. The subscripts of the vectors use the same variable as the for-loop. Please use the following vector names: Mean annual wind speed (mean_ws), highest monthly wind speed (high_ws), lowest monthly wind speed (low_ws), and standard deviation from the mean (std_ws). Required format for the output Enter the number of Air Force bases to be processed: 3 Enter the name of the US Air Force Base: FAIRFIELD-TRAVIS Enter the wind speeds for January through December in brackets: [3.58 4.25 4.92 5.77 6.66 7.55 7.91 7.24 6.39 5.23 3.76 3.98] Enter the name of the US Air Force Base: ANCHORAGE-ELMENDORF Enter the wind speeds for January through December in brackets: [3.26 3.08 3.62 3.40 3.49 3.22 3.04 2.86 2.91 3.00 2.91 3.22] Enter the name of the US Air Force Base: CLOVIS-CANNON Enter the wind speeds for January through December in brackets: [5.59 5.63 6.08 6.17 5.45 5.59 4.78 4.47 4.56 5.05 5.23 5.54] i also have the answer, the professor is only interested in seeing if we can get it to run with correct answers

Explanation / Answer

the following is the code: I have used the same names for output vectors as you have asked ----------------------------------------------------------------------------------------------- clear all; clear screen; n = input('enter the total numbers of Air Force Bases: '); for i = 1:1:n n1 = input('Enter the name of the Air Force Base: ','s'); n2 = input('Enter the array of wind speed values of the respective base: '); mean_ws(i) = mean(n2); %% mean high_ws(i) = max(n2); %% maximum of an array low_ws(i) = min(n2); %% minimum of an array std_ws(i) = std(n2); %% standard deviation disp('the ouput for this naval base is: '); disp(n1(i)); disp('the mean is: '); disp(mean_ws(i)); disp('the maximum is: '); disp(high_ws(i)); disp('the minimum is: '); disp(low_ws(i)); disp('the standard deviation is: '); disp(std_ws(i)); end ----------------------------------------------------------------------------------------------------

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