Answer:
See explaination for program code
Explanation:
%save as AdjustMinValue.m
%Matlab function that takes three arguments
%called number of samples count, user samples
%and min vlaue and then returns a data samples
%that contains values which are double of usersamples
%that less than min vlaue
%
function dataSamples=AdjustMinValue(numberSamples, userSamples, minValue)
dataSamples=userSamples;
%for loop
for i=1:numberSamples
%checking if dataSamples value at index,i
%is less than minValue
if dataSamples(i)<minValue
%set double of dataSamples value
dataSamples(i)= 2*dataSamples(i);
end
end
end
Sample output:
Note:
File name and calling method name must be same
--> AdjustMinValue(4, [2,12,9,20],10)
ans =
4 12 18 20