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

I am not looking for someone to just straight up answer the question for me, as

ID: 3864621 • Letter: I

Question

I am not looking for someone to just straight up answer the question for me, as I have most of the code written the way I know it is meant to be. I am just confused with formatting the data to print at the bottom of the table correctly. below is the code I have written already


clc, clear all


min = input('Enter the minmum kW:') %kw
max = input('Enter the maximum kw:') %kw
kiloWatt = [ ]; %kW
for r = 1:4
    for c = 1:3
        kiloWatt(r,c) = min + rand(1) * (max - min);
    end
end
btu = kiloWatt * 3412.14; %Btu/h
hp = btu ./ 2544.5; %hp
footLbs = kiloWatt * 737.56; % ft lbf/s

fprintf(' Power Conversion Table ')
fprintf(' kW Btu/hr hP LbsF')

Preview File Edit View Go Tools Window Help assign05-1.pdf (page 2 of 3) Problem Constants: (with units as needed Number of rows (4) and columns (3) New commands: Tab Problem Inputs (with units as needed) rand Minimum and maximum kilowatt random number within arange, p.101 Random kilowatt values nested for loops, p 334 https find, p.278-279 Problem outputs: (with units as needed) standard deviation column, p.124 print a matrix as one ft lbf's other variables: (with units as needed) As needed See above. Enter the minimun kw: 15 120 Blank line kW Btu/hr ft lbf/a Column header a over number 100.5 077.0 34.8 74158.7 110.9 37842 1,6 8,7 81798.7 44.2 150961.0 59.3 32631.4 fprintf 116.3 396877.3 156.0 85788.0 Each 4 x 3 matrix printed as a column, P.124 1.4 277740,4 09.2 60035.7 72.4 247115.9 97.1 53416.0 Adjust the field width so number right aligmed. 31.5 107650.9 2.3 23269.6 p.3 Ch07 fprintf. input jh.pdf on Canvas 28.3 96678,3 38.0 20897.7 One decinal place 25.2 86128.4 33.8 1 617.3 115.5 394232.6 154.9 85216.4 Blank line Power Conversion of between averaget/-atandard deviation ft lbf/ Column header 100,5 077,0 34.8 74158.7 right aligned with one decimal Place 110.9 8421.6 48.7 81798.7 156.0 85788.0 110.1 375704.4 7.7 81211.4 277740.4 09.2 60035.7 72.4 247115.9 97.1 53-16.0 115.5 394232.6 54.9 85216.4 116.9 398920.9 156.8 86229.8 239 Fri 8:00 PM Q

Explanation / Answer

clc, clear all

min = input('Enter the minmum kW:') %kw
max = input('Enter the maximum kw:') %kw
kiloWatt = [ ]; %kW
for r = 1:4
for c = 1:3
kiloWatt(r,c) = min + rand(1) * (max - min);
end
end
btu = kiloWatt * 3412.14; %Btu/h
hp = btu ./ 2544.5; %hp
footLbs = kiloWatt * 737.56; % ft lbf/s


%converting each 4 by 3 matrix to 12 by 1 matrix i.e a column vector

btu=reshape(btu,12,1);
hp=reshape(hp,12,1);
footLbs=reshape(footLbs,12,1);
kiloWatt=reshape(kiloWatt,12,1);


fprintf(' Power Conversion Table ')
fprintf(' kW Btu/hr hP LbsF')
fprintf(' %4.1f %4.1f %4.1f %4.1f ', [kiloWatt,btu,hp,footLbs].')

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