Solved

Create an 'arrow-head" matrix

Write a function that when given an odd number, produces an arrow-head function pointing to the right. Examples n = 3 ...

presque 5 ans ago

Solved

Largest Twin Primes

<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...

presque 5 ans ago

Solved

Sort numbers by outside digits

Sort the array so that they are sorted as if their value was a 5 digit number made from the first three and last two digits of t...

presque 5 ans ago

Solved

Given a matrix, return the last eigen value

Given a matrix, return the first eigen value For example: x = magic(5) 17 24 1 8 15 23 5 7 14 ...

presque 5 ans ago

Solved

Integer indexing array: Shift left

Write a *single* statement that shifts row array attendanceValues one position to the left. The rightmost element in attendanceV...

presque 5 ans ago

Solved

Logical indexing: High scores

Row array gameScores contains all player scores. Construct a row array highScores than contains all player scores greater than 5...

presque 5 ans ago

Solved

Relational operators: Guessing game

Row array userGuess contains a sequence of user guesses. Create a logical indexing array correctGuess with true in each location...

presque 5 ans ago

Solved

Indexing the last element: Print queue

* Delete the last element of row array printQueue.

presque 5 ans ago

Solved

Logical indexing: Player scores

Player 1 and player 2 take turns playing a game. Row array gameScores contains the scores of player 1, then player 2, then playe...

presque 5 ans ago

Solved

Next Higher Power of B

|Given a number _n_ and a base _B_ greater than 1, return the lowest integer power of _B_ that is greater than or equal to _n_. ...

presque 5 ans ago

Solved

find radius of cone

if Slant height of Cone(I)& hight of Cone(H) given then find radius of the Cone(R) for example I=5,h=4 then the ans R=3;

presque 5 ans ago

Solved

Test if two numbers have the same digits

Given two integers _x1_ and _x2_, return |true| if the numbers written with no leading zeros contain the same digits. That is, t...

presque 5 ans ago

Solved

Circle area using pi

Write a statement that assigns circleArea with the circle's area given circleRadius. Use the built-in mathematical constant pi. ...

presque 5 ans ago

Solved

Mersenne Primes

A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...

presque 5 ans ago

Solved

Coordinate geometry

Assign pointsDistance with the distance between point (x1, y1) and point (x2, y2). The distance is calculated by: Distance =...

presque 5 ans ago

Solved

Population growth

Assign finalPopulation with the population size given an initial population, population growth rate, and number of years. The fi...

presque 5 ans ago

Solved

Sum the elements in either diagonal of a square matrix

Sum the elements of a square matrix that lie on either the major diagonal or anti-diagonal.

presque 5 ans ago

Solved

Divisors of an integer

Given a number N, return a vector V of all integers that divide N. For example, N = 10 Then V=[1 2 5 10]

presque 5 ans ago

Solved

Integer indexing array: Weekend box office

The row array movieBoxOffice stores the amount of money a movie makes (in millions of $) for the 7 days of a week, starting with...

presque 5 ans ago

Solved

Is the Point in a Circle?

Check whether a point or multiple points is/are in a circle centered at point (x0, y0) with radius r. Points = [x, y]; c...

presque 5 ans ago

Solved

Determine the square root

Determine the square root of the value the user has entered, n.

presque 5 ans ago

Solved

Plus x: A first program

_Solve this problem in Mathwork's online Cody system._ Write a statement that assigns y with 5 plus x. Ex: If input x = 2,...

presque 5 ans ago

Solved

Create a Multiplication table matrix...

Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...

presque 5 ans ago

Solved

Generate a string like abbcccddddeeeee

This is the string version of Problem 1035. <http://www.mathworks.com/matlabcentral/cody/problems/1035-generate-a-vector-like-1-...

presque 5 ans ago

Solved

Area of a triangle

A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.

presque 5 ans ago

Solved

Convert a numerical matrix into a cell array of strings

Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

presque 5 ans ago

Solved

Binary Coder

Take an input number and print the binary value of this number.

presque 5 ans ago