Vous êtes sur la page 1sur 9

Homework No.

1
A. For the next problem, draw the flowchart (points 1, 2 and 3). Solve the problem usin one pro rammin environment (!atlab, Scilab, "ctave). #he matrices and vectors used as data input will have minimum dimensions e$ual to 2%. #hese data can be read from files, direct written into the pro ram or enerated throu h diverse methods at choice. #he text of the problem, flowchart, pro ram input data, results and raphics will be edited in CCE2006 format to ether with eventual comments. &han es, corrections and other homewor' can be imposed b( the class leader and)or at students* su estions. 1. Be a matrix + with NL lines and NC columns. Also, be a vector , with M elements. Get: (1) A vector - with NL elements. ach element o! - is the number o! elements !rom the corres"ondin# line o! + smaller then a #iven value T$ (%) &um o! elements o! , #reater than the maximum o! elements o! +$ (') (atio: (sum o! elements o! +) ) (sum o! elements o! ,)$ (*) Gra"hics: - line, + sur!ace. 2. Be a matrix A with N lines and M columns. Also, be a vector . with N elements. Get: (1) A vector & with N elements. ach element o! & is the sum o! the elements o! A #reater than a #iven value T$ (%) &um o! elements o! . less than the avera#e o! &$ (') (atio: (avera#e o! &) ) (avera#e o! .)$ (*) Gra"hics: & line, A sur!ace. 3. Be a vector A with N elements and a matrix . with N lines and M columns. Get: (1) A vector & with the elements o! A "lus the avera#e o! the corres"ondin# line o! .$ (%) Avera#e o! the "ositive elements o! & multi"lied b+ the sum o! elements o! A belon#in# to the #iven ,s,t- interval. (') (atio: (s.uare root o! the sum o! "ositive elements o! A) ) (the avera#e o! elements o! &)$ (*) Gra"hics: & line, A sur!ace. /. Be a matrix + with N lines and M columns. Also, be a vector , with N elements. Get: (1) /he number o! elements o! + between A and B (A and B are two #iven real numbers)$ (%) /he avera#e o! elements o! , #reater than (A0B))%$ (') (atio: (s.uare root !rom the sum o! s.uares o! elements o! +) ) (the avera#e o! , multi"lied b+ A%0B%)$ (*) Gra"hics: , line, + sur!ace. 0. Be a matrix A with N lines and M columns and a vector . with N elements. Get: (1) /he third order root o! sum o! s.uares o! elements o! A #reater than a #iven real value S$ (%) /he avera#e o! elements o! . multi"lied with the sum o! elements o! the corres"ondin# line in matrix A$ (') (atio: (result !rom (%) above) ) (result !rom (1) above)$ (*) Gra"hics: . line, A sur!ace. 1. Be a matrix S with N lines and M columns. Also, be a vector # with N elements. Get: (1) Number elements o! S #reater than the avera#e o! elements o! #$ (%) &.uare root !rom the sum o! elements o! # at "ower '$ (') (atio: (result !rom (%) above) ) (result !rom (1) above)$ (*) Gra"hics: # line, S sur!ace. 1

2. Be a vector 3 with KX elements. Also, be a matrix 4 with KX lines and KY columns. Get: (1) /he numbers o! lines o! 4 with the sum o! elements in those lines #reater than the corres"ondin# elements o! the vector 3$ (%) Avera#e o! elements o! 3 !rom the interval ,1A,A-, where A is a "ositive real value$ (') (atio: (avera#e o! 4) ) (result !rom (%) above)$ (*) Gra"hics: 3 line, 4 sur!ace. 5. Be a vector && with LA elements. Also, be a matrix FF with JA lines and LA columns. Get: (1) Avera#e o! the "ositive elements !rom the matrix multi"lication FF2&&$ (%) Number o! elements o! && e.ual to 3ero$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: && line, FF sur!ace. 6. Be a matrix 7 s.uare with L lines. Also, be a vector 8 with M elements. Get: (1) Number o! lines o! 7 with at least one 3ero element$ (%) &um o! elements o! 8 multi"lied with the avera#e o! the dia#onal o! 7$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 8 line, 7 sur!ace. 1%. Be a matrix - with LL lines and LC columns. Also, be a vector 7 with LR elements. Get: (1) &um o! lines o! - with their avera#e #reater than a #iven value A$ (%) Avera#e o! "ositive elements o! 7$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 7 line, - sur!ace. 11. Be a vector 3# with KV elements. Also, be a matrix 4# with KV lines and KW columns. Get: (1) /he vector +4(trans"osed o! 3#)24#$ (%) /he number o! columns o! 5/ with at least one "ositive element$ (') (atio: avera#e o! ne#ative elements o! 6 ) (result !rom (%) above)$ (*) Gra"hics: 3# line, 4# sur!ace. 12. Be a matrix A1 with N rows and M columns. Also, be a vector A2 with K elements. Get: (1) &um o! elements o! A2 belon#in# to a #iven interval ,x,y-$ (%) Number o! lines in A1 with "ositive avera#e$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: A2 line, A1 sur!ace. 13. Be a matrix S with IL lines and IC columns. Also, be a vector # with IL elements. Get: (1) /he avera#e o! elements o! #2S !rom a #iven interval ,x,y-$ (%) /he vector o! the sum o! the "ositive elements !rom each column o! &$ (') (atio: (result !rom (%) above) ) (result !rom (1) above)$ (*) Gra"hics: # line, S sur!ace. 1/. Be a vector .3 with K elements. Also, be a matrix .! with L lines and N columns. Get: (1) Avera#e o! elements in belon#in# to the interval ,s,t-, where s and t are #iven$ (%) Number o! elements o! .3 less than (4'.1*)$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: .3 line, .! sur!ace.

10. Be a matrix - with L1 lines and L2 columns. Also, be a vector 3 with L3 elements. Get: (1) A vector A with the avera#e !rom "ositive elements o! each column o! -$ (%) /he s.uare root o! s.uares o! elements o! 3$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 3 line, - sur!ace. 11. Be a matrix S! with N lines and N columns. Also, be a vector S3 with M elements. Get: (1) &um o! the ne#ative elements !rom the dia#onal o! S!$ (%) Avera#e o! the elements o! elements o! &7 #reater than a #iven value A$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: S3 line, S! sur!ace. 12. Be a matrix 9 with I1 lines and I2 columns. Also, be a vector : with I1 elements. Get: (1) A vector A with the sum o! the "ositive elements o! each line o! 9$ (%) /he avera#e o! the vector obtained !rom multi"l+in# each element o! A with each element o! :$ (') (atio: (sum o! elements o! A) ) (results !rom (%) above)$ (*) Gra"hics: : line, 9 sur!ace. 15. Be a matrix ; with N lines and M columns. Also, be a vector < with M elements. Get: (1) A vector A o! the avera#e o! ne#ative elements o! each column o! ;$ (%) /he sum o! elements #reater than 3ero !rom the di!!erence A1<$ (') (atio: (result !rom (%) above) ) (sum o! "ositive elements o! ;)$ (*) Gra"hics: < line, ; sur!ace. 16. Be a matrix -- with KL lines and KC columns. Also, be a vector 88 with KQ elements. Get: (1) /he avera#e o! elements o! -- belon#in# to the #iven interval ,a,b-$ (%) /he sum o! "ositive elements o! 88$ (') (atio: (result !rom (%) above) ) (result !rom (1) above)$ (*) Gra"hics: 88 line, -- sur!ace. 2%. Be a matrix 7 with N lines and M columns. Also, be a vector - with N elements. Get: (1) 5hich is #reater, the sum o! elements "ositive elements o! 7 or the avera#e o! elements o! -8 (%) Number o! lines o! 7 with all the elements bein# "ositive$ (') (atio: (sum o! elements o! 7) ) (result !rom (%) above)$ (*) Gra"hics: - line, 7 sur!ace. 21. Be a vector S with K elements and a matrix = with N lines and K columns. Get: (1) A vector A with the sum o! elements o! each column o! =$ (%) 5hich is #reater, the avera#e o! "ositive elements o! S or the avera#e o! "ositive elements o! A8 (') (atio: (avera#e o! A) ) (sum o! elements o! S)$ (*) Gra"hics: S line, = sur!ace. 22. Be a matrix 7 with N lines and M columns. Also, be a vector - with K elements. Get: (1) Number o! lines o! 7 with a "ositive avera#e$ (%) &um o! elements o! - belon#in# to the interval ,x,y-$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: - line, 7 sur!ace.

'

23. Be a matrix A with N lines and M columns. Also, be a vector . with K elements. Get: (1) /he avera#e o! elements o! . which are less than the sum o! elements o! A$ (%) /he sum o! elements o! A !rom odd lines$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: A line, . sur!ace. 2/. Be a s.uare matrix 8, with N lines. Also, be a vector - with N elements. Get: (1) A vector A, with the elements o! - divided b+ the avera#e o! elements o! 8$ (%) /he sum o! elements o! 8 #reater than a #iven real value X$ (') (atio: (number o! ne#ative elements o! A) ) (results !rom (%) above)$ (*) Gra"hics: - line, 8 sur!ace. 20. Be a matrix & with N lines and M columns. Also, be a vector ; with N elements. Get: (1) /he o! elements o! & #reater than the avera#e o! elements o! ;$ (%) How man+ elements o! ; are ne#ative8 (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: ; line, & sur!ace. 21. Be a matrix & with N lines and M columns. Also, be a vector 4 with N elements. Get: (1) A vector A& with the avera#e o! "ositive elements o! each line o! &$ (%) /he number o! elements o! 4 #reater than the corres"ondin# elements o! A&$ (') (atio: (the sum o! elements o! A&) ) (results !rom (%) above)$ (*) Gra"hics: 4 line, & sur!ace. 22. Be a matrix + with N lines and N columns (s.uare matrix). Also, be a vector , with M elements. Get: (1) /he number o! elements e.ual to 3ero on the secondar+ dia#onal o! +$ (%) /he avera#e o! elements o! , #reater than the sum o! elements o! +$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: , line, + sur!ace. 25. Be a matrix A with N lines and M columns. Also, be a vector . with K elements. Get: (1) &um o! elements o! . belon#in# to the interval ,x,y-, where a and b are #iven$ (%) /he number o! elements o! A #reater than the sum !rom (1)$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: . line, A sur!ace. 26. Be a matrix 4 with N lines and M columns. Also, be a vector # with K elements. Get: (1) 5hich is #reater, the sum o! "ositive elements o! # or the sum elements o! 48 (%) Number o! elements o! 4 #reater than the avera#e o! elements #8 (') (atio: (sum o! elements o! #) ) (results !rom (%) above)$ (*) Gra"hics: # line, 4 sur!ace. 3%. Be a matrix S with KL lines and KC columns. Also, be a vector # with KL elements. Get: (1) /he number o! lines o! S with the sum o! the elements o! that line #reater than the corres"ondin# element in #$ (%) /he avera#e o! the "ositive elements in #$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: # line, S sur!ace.

31. Be a matrix A with N lines and M columns. Also, be a vector . with N elements. Get: (1) /he number o! null elements o! A$ (%) /he avera#e o! elements o! . located in the interval ,x,y-, where x and y are #iven real numbers$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: . line, A sur!ace. 32. Be a matrix -! with N lines and M columns. Also, be a vector -3 with K elements. Get: (1) /he number o! "ositive elements o! -! #reater than the avera#e o! the elements V$ (%) /he sum o! the elements in -! bein# smaller than the sum o! the elements o! -3$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: -3 line, -! sur!ace. 33. Be a matrix 7!A# with N lines and L columns. Be also a vector 73<&# with L elements. Get: (1) /he number o! columns in 7!A# with the avera#e (o! those columns) smaller than the corres"ondin# element in 73<&#$ (%) &.uare root !rom the sum o! s.uares o! "ositive elements !rom 7!A# "lus the sum o! ne#ative elements o! 73<&#$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 73<&# line, 7!A# sur!ace. 3/. Be a matrix +1 with lines and V columns. Be also a vector +2 with ! elements. Get: (1) /he number o! elements o! +1 that belon# to the interval ,minimum o! +2, maximum o! +2-$ (%) /he sum o! elements o! +2 #reater than the avera#e o! "ositive elements o! +1$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: +2 line, +1 sur!ace. 30. Be a matrix & with S1 lines and S2 columns. Be also a vector 3 with T elements. Get: (1) /he #eometric avera#e o! elements o! & #reater than the avera#e o! "ositive elements o! 3$ (%) /he number o! elements o! 7 belon#in# to the interval ,minimum o! &, maximum o! &-$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 3 line, & sur!ace. 31. Be a matrix !A# with N lines and M columns. Be also a vector 3<& with elements. Get: (1) Number o! lines in !A# that have the #eometric avera#e #reater than the sum o! "ositive elements o! the vector 3<&$ (%) /he avera#e o! elements o! - smaller in value than the maximum o! the elements !rom the last column o! !A#$ (') 5hich is #reater: the result !rom (1) above or the result !rom (%) above8$ (*) Gra"hics: 3<& line, !A# sur!ace. 32. Be a matrix S with N lines and N columns (s.uare matrix). Be also a vector Sv with elements. Get: (1) /he number o! elements !rom the !irst (main) dia#onal o! Sm that belon# to the interval ,9#eometric avera#e o! Sv9, avera#e o! Sv- or ,avera#e o! Sv, 9#eometric avera#e o! Sv9- whichever has sens$ (%) &um o! elements o! Sm smaller than the maximum o! Sv$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: Sv line, Sm sur!ace.

35. Be a matrix !> with lines and R columns. Be also a vector 3> with Q elements. Get: (1) /he sum o! s.uares o! elements o! !> belon#in# to the interval ,1N1, N1-, where the N1 is the sum o! elements o! 3> #reater than minimum o! "ositive elements o! !>$ (%) /he number o! elements o! 3> that do not exceed the harmonic avera#e o! non13ero elements o! !>$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 3> line, !> sur!ace. 36. Be a matrix 8 with L" lines and C" columns. Be also a vector 7 with N# elements. Get: (1) /he avera#e o! elements in 8 that belon# to the interval ,19S9,9S9-, where S is the sum o! elements o! 7 #reater than the maximum o! ne#ative elements o! 8$ (%) /he number o! elements o! ( lower than (8(1,1)08(L",C"));%)%$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 7 line, 8 sur!ace. /%. Be a matrix ;mat with $L lines and $C columns. Be also a vector ;vec with $% elements. Get: (1) Harmonic avera#e o! elements o! ;mat belon#in# to the interval ,1<, <-$ (%) /he number o! elements o! ;v that do not sur"ass the avera#e o! "ositive elements o! ;mat$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 7 line, 7 sur!ace. /1. Be a matrix ? with JL lines and JC columns. Be also a vector @ with KE elements. Get: (1) /he sum o! elements !rom @ that do not belon# to the interval ,1sum o! "ositive elements o! ?, 9maximum o! ne#ative elements o! ?9-$ (%) /he number o! elements o! ? that are smaller than %< and are located on odd lines$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: @ line, ? sur!ace. /2. Be a matrix 3!A# with lines and columns (s.uare matrix). Be also a vector 33<& with elements. Get: (1) /he number o! columns o! 3!A# that have the #eometric avera#e #reater than the corres"ondin# element !rom the 33<&$ (%) /he s.uare root o! sum o! s.uares o! ne#ative elements !rom the secondar+ dia#onal o! 3!A#$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 33<& line, 3!A# sur!ace. /3. Be a matrix 91 with N lines and M columns. Be also a vector 92 with elements. Get: (1) /he sum o! avera#es o! ne#ative elements !rom each line o! 91$ (%) /he number o! elements o! 92 lower than minimum o! elements !rom 91 belon#in# to a #iven interval ,a, b-$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 92 line, 91 sur!ace. //. Be a matrix !> with L! lines and C! columns. Be also a vector 3A with L! elements. Get: (1) /he number o! lines in !A with the harmonic avera#e less than the corres"ondin# element in 3A$ (%) /he sum o! elements o! 3A that do not belon# to the interval ,19sum o! elements o! !A9, 9sum o! elements o! !A9$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 3A line, !A sur!ace. =

/0. Be a matrix Smat with N&at lines and M&at columns. Be also a vector Svec with K%'( elements. Get: (1) /he avera#e o! elements o! in Svec that do not belon# to the interval ,1avera#e o! "ositive elements o! Smat, avera#e o! "ositive elements o! Smat-$ (%) /he number o! elements o! Smat #reater than the harmonic avera#e o! ne#ative elements o! Svec$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: Svec line, Smat sur!ace. /1. Be a matrix -m with L& lines and C& columns. Be also a vector -v with E% elements. Get: (1) Number o! elements o! -v that are less than the avera#e o! "ositive elements o! -m$ (%) /he sum o! elements o! >m that belon# to the interval ,minimum o! elements o! >v, maximum o! elements o! >v- and are located on odd lines$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: -v line, -m sur!ace. /2. Be a matrix F1 with )* lines and )( columns. Be also a vector F2 with )' elements. Get: (1) /he sum o! all elements o! ?1 that do not belon# to the interval ,1avera#e o! "ositive elements o! F2, avera#e o! "ositive elements o! F2-$ (%) /he number o! elements o! F1 located on even columns and are #reater that the #eometric avera#e o! F2$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: F2 line, F1 sur!ace. /5. Be a matrix 4 with W*+, lines and W(-* columns. Be also a vector 3 with V'* elements. Get: (1) /he avera#e o! "ositive elements o! 4 and "ositive elements o! 3$ (%) 5hish is #reater: the number o! lines o! 4 with an avera#e di!!erent !rom 3ero, or the number o! ne#ative elements o! 38$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 3 line, 4 sur!ace. /6. Be a matrix + with Lx lines and Cx columns. Be also a vector ,u with Ey elements. Get: (1) /he harmonic avera#e o! elements in +u that are located in the interval ,sum o! ne#ative elements o! ,u, sum o! "ositive elements o! ,u-$ (%) /he number o! elements in ,u #reater than the result !rom "oint (1) above$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: ,u line, +u sur!ace. 0%. Be a matrix 3 with N lines and M columns. Be also a vector = with elements. Get: (1) A vector + with the elements e.ual to the avera#e o! "ositive elements !rom each column o! 3$ (%) /he number o! elements o! = that belon# to the interval ,minimum o! elements o! 3, maximum o! elements 3-$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: = line, 3 sur!ace. 01. Be a matrix -mat with * lines and ( columns. Be also a vector -vec with * elements. Get: (1) the number o! lines o! -mat with the avera#e #reater than the corres"ondin# element o! the vector -vec$ (%) /he sum o! elements in -vec belon#in# to the interval ,11@<, 1@<-$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: -vect line, -mat sur!ace. A

02. Be a matrix B with V lines and . columns. Be also a vector ! with W elements. Get: (1) /he maximum value o! elements in B that belon# to the interval ,maximum o! ne#ative elements in B, minimum o! "ositive elements in B-$ (%) Avera#e o! maximum o! each column in matrix B$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 7 line, 7 sur!ace. 03. Be a matrix # with T*+, lines and T(-* columns. Be also a vector 3 with V'* elements. Get: (1) /he line o! # with the lar#est element smaller than the avera#e o! elements o! 3$ (%) /he number o! elements in 3 belon#in# to the interval ,minimum o! elements o! #, maximum o! elements o! #-$ (') 5hich is lar#er: result !rom (1) above or result !rom (%) above8$ (*) Gra"hics: 3 line, # sur!ace. 0/. Be a matrix 4 with W*+, lines and W(-* columns. Be also a vector 3 with V'* elements. Get: (1) /he minimum o! elements in 3 that belon# to the interval ,19maximum o! elements o! matrix 49, 9minimum o! elements o! vector 49-$ (%) /he sum o! elements o! 4 #reater than the avera#e o! elements o! 3$ (') (atio: (result !rom (1) above) ) (result !rom (%) above)$ (*) Gra"hics: 3 line, 4 sur!ace.

.. For the next simple supported beam loaded as shown in the fi ure, draw the flowchart write a computer pro ram usin one pro rammin environment (!atlab, Scilab, "ctave) for calculation and drawin the shear forces and bendin moment dia rams. !a'e two versions pro ramC a DclassicalE format and one usin function procedure. #he text of the problem, flowchart, pro ram input data, results and raphics will be edited in CCE2006 format to ether with eventual comments. &han es, corrections and other homewor' can be imposed b( the class leader and)or at students* su estions. 1.

Vous aimerez peut-être aussi