A wind turbine can have 2, 3, or 4 blades. The more blades, the higher the power of the turbine. Write a function with one input and no outputs, where the input is the number of blades. Use a switch statement to write to the screen Low Power Medium Power or High Power where "Low Power" corresponds to 2 blades, "Medium Power" corresponds to 3 blades, and "High Power" corresponds to 4 blades.

Respuesta :

Answer:

MATLAB Script:

close all

clear

clc

fprintf('Number of blades = 2:\n-------------------------\n')

power(2)

fprintf('\nNumber of blades = 3:\n-------------------------\n')

power(3)

fprintf('\nNumber of blades = 4:\n-------------------------\n')

power(4)

function power(n)

switch n % n = number of blades

case 2

disp('Low Power')

case 3

disp('Medium Power')

case 4

disp('High Power')

otherwise

disp('Invalid number of blades')

end

end

Explanation:

ACCESS MORE
EDU ACCESS