Write a function that will receive as input either a single


Problem

A factorial is the product of all positive integers less than or equal to a given positive number. Write a function that will receive as input either a single positive number or a vector of positive numbers and return the factorials as a vector.

For example, if 5! is passed to the function, the returned value would be 120 (1*2*3*4*5). Likewise, if a vector [6 4 2 1] is passed, the function will return a vector with the factorial of every element in the input vector. Make sure you use a for loop in your solution.

function output = fact2prod(n)

Request for Solution File

Ask an Expert for Answer!!
Business Management: Write a function that will receive as input either a single
Reference No:- TGS02780958

Expected delivery within 24 Hours