{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

P_S_ _2 Jesse Vella Edit1

P_S_ _2 Jesse Vella Edit1 - :Package elmstreet=[1 3 2 1...

This preview shows pages 1–4. Sign up to view the full content.

(* ::Package:: *) ( elmstreet= [1, 3, 2, 1, 35000; 2, 5, 2, 3, 41000; 3, 2, 1, 1, 25000; 4, 2, 2, 0, 56000; 5, 4, 2, 2, 62000; 6, 5, 3, 2, 83000; 7, 1, 1, 0, 52000] % Discussion Question 4.2 Q elmstreet = e 1 3 2 1 35000 2 5 2 3 41000 3 2 1 1 25000 4 2 2 0 56000 5 4 2 2 62000 6 5 3 2 83000 7 1 1 0 52000 mean (elmstreet (:, 5)) % Part 5 m ans = a 5.0571e+04 sum (elmstreet (:,5)) ./ sum(elmstreet (:,3)) % Part 6 s ans = a 2.7231e+04 sum (elmstreet (find (elmstreet (:,4)>0), 5)) ./ sum(elmstreet (find (elmstreet (:,4)>0), 3)) % Part 7 ( ans = a 24600 sum (elmstreet (find (elmstreet (:,4)==0), 5)) ./ sum(elmstreet (find (elmstreet (:,4)==0), 3)) ( ans = a 36000 all ( elmstreet (:,3) + elmstreet (:,4) == elmstreet (:,2)) % Part 8 a ans = a 1

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

View Full Document
sum (matrix (:,4)>0) ./ sum(matrix (:,4)>=0) .* 100 % Question 2 Part 1 s ans = a 53.3333 sum (matrix (find (matrix (:,4)>0), 4) ./ 20) ./ sum(matrix (:,4)>0) s ans = a 0.9875 matrix (find (matrix (:,4)>=20), [1, 2]) % Part 2 m ans = a 19535 202 13266 220 20991 177 29922 211 mean (matrix (:,2)) % Part 3 m ans = a 180 mean (matrix (find (matrix (:,4)>0), 2)) m ans = a 195.8750 (mean (matrix (find (matrix (:,4)>0), 2)) - mean (matrix (find (matrix (:,4)==0), 2))) ./ mean(matrix (find (matrix (:,4)>0), 2)) .* 100 2 ans = a 17.3671
matrix (find ((matrix (:,3))==max (matrix (:,3))), [1, 3]) % Part 4 m ans = a 14762 85 max (matrix (find (matrix (:,3)<max (matrix (:,3))), [1,3])) m ans = a 31014 83

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

P_S_ _2 Jesse Vella Edit1 - :Package elmstreet=[1 3 2 1...

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

View Full Document
Ask a homework question - tutors are online