Question
This is in matlab language Create the function described below: 1.Function name should be problem_2 2.Function should accept 2 input arguments. The first input argument
This is in matlab language
Create the function described below:
1.Function name should be problem_2
2.Function should accept 2 input arguments. The first input argument should be called iterations, the second input argument should be called the_number.
3.Function should have 2 output arguments. The first should be called result, and the second should be called loop_counter.
The function body should do the following:
4.It should create a for loop that will start at 1 and repeat "iterations" times. That is, the input argument called iterations, has a number inside. This number represents how many times the loop should repeat. The variable that is used to initialize your loop array (the thing that determines how many times your loop repeats) should be called loop_counter.
5.Each time the loop repeats, you should add the current value of your loop counter variable to whatever value is currently inside the input argument "the_number" and add this answer to whatever is in your output argument called result.
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