{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture3 - for V = 5:5:60 for T = 40-5-45 WC =...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
±² ³´µ ¶·¸¹º»· ¼ ½¾¹·¿ ÀºÁ¶ÂÁ½Ã Ä ÅÁ½Â¸ÆÁ¶¶ ¹ÄǶ· ± ²³´µ µ¶ ·¸¹º» µ¼¹½ µ³·º¾¿ À´¾ ²³Á ¹½ µ¶ ¸½¾ ³ ¶¸Ãº¾ ¶Ä º¶¶Ã½ ¹´ ³ ½ÂŹõ¿ for V = 5:5:60 for T = 40:-5:-45 WC = round(FWC(T,V)); fprintf( '%4.0f ' ,WC); end fprintf( '\n' ); end µ¼¾´ ³ºº µ¼¾ ½ÂŹõ >> WCtable 36 31 25 19 13 7 1 -5 -11 -16 -22 -28 -34 -40 -46 -52 -57 -63 34 27 21 15 9 3 -4 -10 -16 -22 -28 -35 -41 -47 -53 -59 -66 -72 32 25 19 13 6 -0 -7 -13 -19 -26 -32 -39 -45 -51 -58 -64 -71 -77 30 24 17 11 4 -2 -9 -15 -22 -29 -35 -42 -48 -55 -61 -68 -74 -81
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
29 23 16 9 3 -4 -11 -17 -24 -31 -37 -44 -51 -58 -64 -71 -78 -84 28 22 15 8 1 -5 -12 -19 -26 -33 -39 -46 -53 -60 -67 -73 -80 -87 28 21 14 7 0 -7 -14 -21 -27 -34 -41 -48 -55 -62 -69 -76 -82 -89 27 20 13 6 -1 -8 -15 -22 -29 -36 -43 -50 -57 -64 -71 -78 -84 -91 26 19 12 5 -2 -9 -16 -23 -30 -37 -44 -51 -58 -65 -72 -79 -86 -93 26 19 12 4 -3 -10 -17 -24 -31 -38 -45 -52 -60 -67 -74 -81 -88 -95 25 18 11 4 -3 -11 -18 -25 -32 -39 -46 -54 -61 -68 -75 -82 -89 -97 25 17 10 3 -4 -11 -19 -26 -33 -40 -48 -55 -62 -69 -76 -84 -91 -98 >> The whole computation can be done without loops however. Remember that the FWC function is vectorized, so it can handle two T and V vectors: FWC.m function [W] = FWC(T,V) %FWC computes windchill in Fahrenheit % expects temp in T and velocity in V W = 35.74 + 0.6215*T - 35.75*V.^0.16 +.4275.*T.*V.^0.16; %fprintf('The windchill is %8.2fF\n',W); end So, instead we can build this script: % create vector of all temperatures T = 40:-5:-45; %create vector of all wind speeds V = 5:5:60; % find how many temps and how many velocities Tlen = length(T); Vlen = length(V); % create a matrix of temperatures where each row of % temperatures is repeated Vlen times Tmat = repmat(T,Vlen,1); % flip the velocities to a column and create a matrix % of velocities where each column of V is repeated Tlen times
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

lecture3 - for V = 5:5:60 for T = 40-5-45 WC =...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online