Arithmetic array operations Add adjustVal to each element of array originalReadings. Your Functio…
The following solution is suggested to handle the subject “Arithmetic array operations Add adjustVal to each element of array originalReadings. Your Functio…“. Let’s keep an eye on the content below!
Question “Arithmetic array operations Add adjustVal to each element of array originalReadings. Your Functio…”
Arithmetic array operations Add adjustVal to each element of array originalReadings. Your Function Save C Reset MATLAB Documentation 1 function modifiedReadingsCalibrateReadings (originalReadings, adjustVal) 21% origina!Readings: Array of temperature readings 31% adjustval: value added to each element in the array of temperature readings 4. % Add adjustval to each element of array origina!Readings modifiedReadings e 6 7 end Code to call your function C Reset 1 CalibrateReadings([51, 53, 61, 62], 1)
Indexing an array element Assign studentScore with the second element of array classScores. Your Function E Save C Reset MATLAB Documentation 1 function studentScore GetScore(classScores) 21% classscores: Array of test scores % Assign studentscore with the second element of array classscores studentScore = e; 7 end Code to call your function C Reset GetScore([99, 85, 71])
Indexing the array: Moving values Write three statements to shift the SampleReadings’ contents 1 position to the left. The rightmost element after shifting should be assigned -1 Ex: If SampleReadings is [12, 85, 43], then after shifting SampleReadings becomes [85, 43, -1]. Your Function Save C Reset MATLAB Documentation 1 function sampleReadings – ShiftValues(sampleReadings) 2% sampleReadings: Array containing 3 elements % Write three statements to shift the sampleReadings array contents 1 position to the left % Note: The rightmost element should be -1 sampleReadings -sampleReadings; 4 6 8 end Code to call your function C Reset 1 ShiftValues ([12, 85, 43])
Answer
Hi, please find the Q1 and Q2 answer attached below. If you found the answer helpful, please leave a thumbs up rating. We are grateful and wish you a pleasant day.
1.
************ Matlab function definition ***********
function modifiedReadings = CalibrateReadings(originalReadings,adjustVal)
ModifiedReadings = originalReadings + adjustVal
End
********* End Of Code *********
Output: