1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
solniwko [45]
3 years ago
11

Modify an array's elements Write a for loop that iterates from 1 to numberSamples to double any element's value in dataSamples t

hat is less than minValue. Ex: If minVal = 10, then dataSamples = [2, 12, 9, 20] becomes [4, 12, 18, 20]. Function Save Reset MATLAB DocumentationOpens in new tab function dataSamples = AdjustMinValue(numberSamples, userSamples, minValue) % numberSamples: Number of data samples in array dataSamples % dataSamples : User defined array % 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 dataSamples = userSamples; end 1 2 3 4 5 6 7 8 9 10 Code to call your function
Computers and Technology
1 answer:
ValentinkaMS [17]3 years ago
3 0

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

You might be interested in
Questions about the data policy and privacy policy of YT
Ilya [14]

Answer:

I'm confused

Explanation:

7 0
3 years ago
What should you do when an error message pops up on the screen?
Shtirlitz [24]
The best thing to do when an error message appears when it is not supposed to, as in if you are blocked by an administrator and it appears then its supposed to, it is best to contact someone who can investigate whether or not something is happening to your computer. That could be a parent, if they are good with computers, or just tech support at a store, provided they also know computers. Most of the time your computer just makes a mistake so nothing to worry about, but make sure to have it checked just to be sure. 
7 0
3 years ago
Computer network reduce the cost true or false​
kogti [31]
True... computer network reduces cost
7 0
2 years ago
What software in windows 8 serves as built-in antivirus software?
Llana [10]
It is called 'Windows Defender'
6 0
3 years ago
A user would like to format an arrow that has been inserted into a chart. What is the most efficient method for completing this
kumpel [21]

Answer:

C

Explanation:

double-clicking the arrow and making adjustments in the Drawing Tools tab

5 0
3 years ago
Other questions:
  • Choose all statements that identify the benefits of programming design.
    10·2 answers
  • What is one disadvantage of accessing the Internet through a public search engine such as Google or Yahoo?
    10·2 answers
  • Which option allows you to customize the order of your data ?
    8·2 answers
  • 60 POINTS!
    13·1 answer
  • This is pixlr
    6·1 answer
  • The arrows in this question indicated the determination of two attributes. For example, the arrow that goes ProductID to Product
    11·1 answer
  • Bye guys imma k.ill myself for real this time.
    11·2 answers
  • What part of the meat help you identify the less tender cuts​
    13·1 answer
  • Book information (overriding member methods) Given main() and a base Book class, define a derived class called Encyclopedia. Wit
    12·1 answer
  • modify hw 02 c.c to use envp instead of environ. be sure that you understand how the code works. provide liberal comments to exp
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!