Question: USE MATLAB AND CORRECT MATLAB FUNCTIONS Write a function with one input and no outputs. The input will be an integer. The resulting value which
Write a function with one input and no outputs. The input will be an integer. The resulting value which will print to the screen will be the product of all integers from 2 through the input value, which is the factorial of the number. After the loop, also calculate the factorial of the number using the built-in MATLAB function factorial. Print the value of the factorial calculated in the loop and the value from the MATLAB function to the screen. Test the function using the input value 10, which should result in an answer of 3,628,800. Write a function to print an array of stars to the screen in the form of an isosceles triangle. The function will have one input and no outputs. The input will be the number of stars in the base of the triangle. Here's an example of what the output would look like for an input value of 9: 3. 4. Since the input value must be an odd number, include a test at the beginning of the function to check that the input is odd. One way to do this is to use the built-in MATLAB mod function. The mod function returns the remainder when dividing one integer by another. For example, mod(6,2)-0, since the remainder is zero when dividing 6 by 2. mod(7,2) -1, since dividing 7 by 2 results in a remainder of 1. Hint: use nested loops. The outer loop will be over the rows, and the inner loop over the columns. The indices of the inner loop will be a function of the row number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
