Question: NO NEED TO ANSWER ANYMORE. I SOLVED IT Problem 1A. Write a MATLAB function mysequence(n), that reads the value n, and returns the nth element
NO NEED TO ANSWER ANYMORE. I SOLVED IT
Problem 1A. Write a MATLAB function mysequence(n), that reads the value n, and returns the nth element in the sequence below. 4,+2 6,+3 9,+4 13,+5 18,+6 24,+7 31,+8 39,+9 48 In other words 4 plus 2 equals 6, plus 3 equals 9, plus 4 equals 13 For example, mysequence(3) return 9, mysequence(8) returns 39.
Problem 1B. Write a MATLAB function mygeomean that calculates the geometric mean of a set of numbers. The function should read a vector of number (any length), and return the geometric mean. Geometric mean is It is the nth root of the product of n numbers. Examples: mygeomean ([1.38 1.76 1.17]) = (1.38 x 1.76 x 1.17)1/3 , mygeomean(([1.38 1.76 1.17 0.79]) = (1.38 x 1.76 x 1.17 x 0.79)1/4 You are not allowed to use any predefined MATLAB function to solve this problem. This problem is to be solved using loops. The user should be able to use the function for a vector of any size.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
