A résolu


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2 3 3 3 4...

environ 2 mois il y a

A résolu


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Input...

environ 2 mois il y a

A résolu


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

environ 2 mois il y a

A résolu


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

environ 2 mois il y a

A résolu


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displayed ...

environ 2 mois il y a

A résolu


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

environ 2 mois il y a

A résolu


Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

environ 2 mois il y a

A résolu


Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

environ 2 mois il y a

A résolu


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the numbers. Otherwise return false. Example...

environ 2 mois il y a

A résolu


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

environ 2 mois il y a

A résolu


Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...

environ 2 mois il y a

A résolu


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

environ 2 mois il y a

A résolu


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

environ 2 mois il y a

A résolu


Is my wife right?
Regardless of input, output the string 'yes'.

environ 2 mois il y a

A résolu


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

environ 2 mois il y a

A résolu


Pizza!
Given a circular pizza with radius z and thickness a, return the pizza's volume. [ z is first input argument.] Non-scored bonus...

environ 2 mois il y a

A résolu


The Five Infection (Boss Level)
Given a 3x3 matrix A, replace: every value that is equal to five every value that is directly adjacent to a five with zero in...

environ 2 mois il y a

A résolu


Fives Begone
Given any sentence as an input value 'sentence', turn all fives into the letter X and return the improved sentence. Also, turn a...

environ 2 mois il y a

A résolu


Broken Clock
Create a function that outputs t, an inputted matrix time x, in hours and minutes (hr:min) unless the time contains a five. In t...

environ 2 mois il y a

A résolu


No Fives Permitted
Create a function that gives users an custom error message if the matrix A contains a five. The error message should say "No Fiv...

environ 2 mois il y a

A résolu


A Fiveless Factorial
Given a positive integer x, compute its factorial y, but exclude any muliplication by five if applicable.

environ 2 mois il y a

A résolu


Don't Sum a Five
Create a function that sums the first and last element of a muti-element vector unless the value of one of the elements is 5. Do...

environ 2 mois il y a

A résolu


Don't Include a Five (Part Two)
Given a vector A with at least one non-five, return vector B, with all fives excluded (not replaced by zeros).

environ 2 mois il y a

A résolu


Don't Include a Five
Given a vector A, return vector B with all 5s replaced with 0s.

environ 2 mois il y a

A résolu


High Five!
Write a function that takes a number x and returns y = 'High Five' if x is not equal to five. Return y = 'Denied' if the number ...

environ 2 mois il y a

A résolu


A Five Introduction
Write a function that takes a number x as an input and returns the same value as y, unless x = 5, in which case the function sho...

environ 2 mois il y a

A résolu


Add two numbers
Given a and b, return the sum a+b in c.

environ 2 mois il y a

A résolu


Is A the inverse of B?
Given a matrix A and a matrix B, is A the inverse of B? >>A=[2,4;3,5]; >>B=[-2.5,2;1.5,-1]; >>isInverse...

environ 2 mois il y a

A résolu


Rotate Matrix @180 degree
Rotate Matrix @180 degree Example A=[8 1 6; 3 5 7; 4 9 2], then answer would be [2 9 4;...

environ 2 mois il y a

A résolu


Converts numbers into characters
Converts numbers into characters

environ 2 mois il y a

Charger plus