Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Modify an array's elements Write a for loop that iterates from 1 to numberSamples to double any element's value in dataSamples that is less than
Modify an array's elements Write a for loop that iterates from 1 to numberSamples to double any element's value in dataSamples that is less than minValue. Ex: If minVal = 10, then dataSamples = [2, 12.9.20] becomes [4. 12, 18, 20). Function Save C Reset MATLAB Documentation 1 function dataSamples = AdjustMinValue (numberSamples, user Samples, minvalue) 2 % numberSamples: Number of data samples in array dataSamples 3 % dataSamples : User defined array 4 % minValue : Minimum value of any element in array % Write a for loop that iterates from 1 to numberSamples to double any element's % value in dataSamples that is less than minvalue 7 8 9 10 end Code to call your function Reset 1 AdjustMinValue(4, [2, 12, 9, 20), 10) Assessment: Submit Check if AdjustMinValue(4, [2, 12, 9, 20), 10) returns [4, 12, 18, 20] Check if AdjustMinValue(6, [100, 75, 50, 26, 62, 99], 100) returns [100, 150, 100, 52, 124, 198] Check if AdjustMinValue(2, [11, 18], 5) returns [11, 18]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started