A vector v stores for several employees of the Green Fuel Cells Corporation their hours worked one week followed for each by the hourly pay rate. For example, if the variable stores
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:2| Question number:40.2
All Answers
total answers (1)
>> hours = v(1:2:length(v))
hours =
33 40 20
>> payrate = v(2:2:length(v))
payrate =
10.5000 18.0000 7.5000
>> totpay = hours .* payrate
totpay =
346.5000 720.0000 150.0000
need an explanation for this answer? contact us directly to get an explanation for this answer