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
What is the working principle of computer?
ankoles [38]
The CPU is the working principle
8 0
4 years ago
Assume you are given a boolean variable named isSquare and a 2-dimensional array that has has been created and assigned to a2d.
slamgirl [31]

Answer:

isSquare = true;

for (int i = 0; i < a2d.length && isSquare; i++)

if (a2d[i].length != a2d.length)

isSquare = false;

Explanation:

3 0
3 years ago
When he takes a picture, Simon freezes an action without blurring it, to show movement. Which type of photographer is he?
Jlenok [28]

Answer:

freezing action photographer i think this is the type.... i don't know much about photography yet

Explanation:

6 0
3 years ago
Read 2 more answers
What research method in sociology is also referred as fieldwork
Tanya [424]
The answer is Field research  
8 0
3 years ago
Which issue of computer ethics is concerned about the technological division in the society?​
Molodets [167]

Answer:

There are many legal and ethical issues with computers that can be exploited by bad people to do bad things. Some of those issues include illegal music and video file downloading, spyware, identity theft, phishing, keystroke logging, packet sniffing and cyberbullying

7 0
3 years ago
Read 2 more answers
Other questions:
  • What is a locally stored url, or the address of a file or internet page saved as a shortcut?
    10·1 answer
  • After which stage in the information processing cycle can data be referred for future use?
    7·1 answer
  • Why were american colonists unhappy with king george iii?
    6·2 answers
  • We need ____ pointers to build a linked list.
    6·1 answer
  • Write a program that computes the minimum, maximum, average and standard deviation of the population over time for a borough (en
    6·1 answer
  • Complete the GiftCard class shown below. A GiftCard keeps track of the current balance on the card. A gift card starts with a be
    11·1 answer
  • FOR DIGITAL DESIGN/ PHOTOGRAPHY
    5·2 answers
  • Match the definition
    14·1 answer
  • onsider a file system on a disk that has both logical and physical block sizes of 512 bytes. assume that the information about e
    9·1 answer
  • What type of os must be installed on your machine to allow this type of action by another person?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!