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]
2 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]2 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
When Maggie attempted to reconcile her company's monthly sales revenue, she used a TOTALS query to sum the sales from the invoic
shusha [124]

Answer:

The correct answer is "Consistency".

Explanation:

  • It should have been continuous to have the information management service. All information must have been linked, gathered using the same technique as well as measurement but also displayed simultaneously frequencies.
  • Throughout this query, Maggie considers the organization proceeds by a system whereby financial transactions online are not influenced by trade payables or rebates as they are separate accounts that are afterward adjusted for the business model.

Thus, the above is the correct answer.

6 0
3 years ago
50-75 words about what motivates you in academic life and are these motivators different from what motivates you in your persona
drek231 [11]

<u>Answer:</u>

<em>My teachers & My parents are the main reason to get through academics well. </em>

Though the reason might be common to most of the people, <em>the situation might be unique and the way the advice's are comprehended and the process of intake and the actions would be unique to each person.</em>

How a mother gives medicine to a child along with sugar, in a similar way my <em>parents and teachers gave me advice which made me to stand at this top-level.</em>

6 0
3 years ago
Sending packets with false ip source addresses is called ____. ip address spoofing a port scanning attack a ip address scanning
Eddi Din [679]
<span>Sending packets with false IP source addresses is called </span>IP address spoofing 
6 0
3 years ago
Select all that apply. A picture may be resized by using the: resizing handles on the graphic Size grouping in the Pictures tool
Sedaia [141]

Answer:

resizing handles on the graphic

Size grouping in the Pictures tools tab

Explanation:

Hope this helps

8 0
3 years ago
Your task is to design a method int[] allMatches(int[] values, int size, int a, int b) that returns all values between a and b i
iogann1982 [59]

The program that returns all values between a and b inclusive in the partially filled array values is illustrated below.

<h3>What is a program?</h3>

A computer program means a sequence or set of instructions that is in a programming language for a computer to execute.

Here, the program based on the information given will be:

count = 0

for each v in values

if a <= v <= b

 count++

result = new int[count]

i = 0

for each v in values

if a <= v <= b

 result[i] = v

 i++

return result

Java code:

public class ArrayRange {

public static int[] allMatches(int[] values, int size, int a, int b) {

 int count = 0;

 for (int i = 0; i < size; i++) {

  if(values[i] >= a && values[i] <= b) {

   count++;

  }

 }

 int result[] = new int[count];

 count = 0;

 for (int i = 0; i < size; i++) {

  if(values[i] >= a && values[i] <= b) {

   result[count++] = values[i];

  }

 }

 return result;

}

public static void main(String[] args) {

 int[] a = {11, 3, 9, 4, 2, 5, 4, 7, 6, 0};

 int[] returnedArray = allMatches(a, 8, 3, 7);

 for (int i = 0; i < returnedArray.length; i++) {

  System.out.print(returnedArray[i] + " "

Learn more about program on:

brainly.com/question/1538272

#SPJ1

5 0
2 years ago
Other questions:
  • You use_____ to view an XPS file
    10·1 answer
  • What is the difference, if any, between secure HTTP and firewalls?
    13·1 answer
  • Malcolm Movers charges a base rate of $200 per move plus $150 per hour and $2 per mile. Write a program named MoveEstimator that
    5·1 answer
  • When browsing using certain browsers, if a page is known to be malicious or using phishing techniques in the past a browser may
    5·1 answer
  • 4.15 LAB: Password modifier
    14·1 answer
  • Write any four common hardware devices​
    6·1 answer
  • What is composition
    13·1 answer
  • Can someone answer me
    13·1 answer
  • URGENTT 2 SIMPLE EASY QUESTIONS PLZZ HELP ION UNDERSTAND COMPUTERR ILL GIVE U BRAINLEST
    5·2 answers
  • In python please:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!