Solved

Multielement indexing of a row array
The row array birthRateChina stores the China birth rate (per 1000 people) for years 2000 to 2012. Write a statement that create...

ungefär 8 år ago

Solved

Create a row array using double colon operator
Create a row array from 9 to 1, using the double colon operator.

ungefär 8 år ago

Solved

Three grind is shipsstraigt
A function that returns either 'Rock', 'Scissors', or 'Paper' (string). You may succeed or you may fail the (case insensitive) t...

ungefär 8 år ago

Solved

Calculate the probability that at least two people in a group share the same birthday.
Calculate the probability that at least two people in a group share the same birthday. Given an integer input n, return to 0.015...

ungefär 8 år ago

Solved

The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

ungefär 8 år ago

Solved

Maintain shape of logical-index mask
When using logical indexing into an array, MATLAB returns a vector output. For example, if A = magic(3); mask = logi...

ungefär 8 år ago

Solved

Possible Outcomes of American Roulette
The payout for American roulette can be calculated by: payout = (38/n)-1 where n is the number of squares the bet covers. ...

ungefär 8 år ago

Solved

mathematics , probability problem
How many different result can we have, rolling k dice?

ungefär 8 år 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.

ungefär 8 år ago

Solved

commutative?
Given the handle to a binary function that takes two ordinary numbers, test if the function is commutative.

ungefär 8 år ago

Solved

root?
* Given a function 'foo', and a position 'there', find the root near 'there'. * For example: If foo=@sin, and there=3.1, then r...

ungefär 8 år ago

Solved

Determine if input is a Narcissistic number
<http://en.wikipedia.org/wiki/Narcissistic_number Narcissistic number> is a number that is the sum of its own digits each raised...

ungefär 8 år ago

Solved

Close MATLAB with keyboard
Close MATLAB with keyboard without using mouse

ungefär 8 år ago

Solved

Accessing elements on the diagonal
Access the diagonal elements of a matrix without 'diag' function

ungefär 8 år ago

Solved

Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
Given a number _n_, return the terminal value of the number chain formed by summing the square of the digits. According to the P...

ungefär 8 år ago

Solved

Volume of a Parallelepiped
Calculate the volume of a Parallelepiped given the vectors for three edges that meet at one vertex. A cube is a special case ...

ungefär 8 år ago

Solved

Center of mass
Given a matrix M(m,n), where m is the number of vertices of the geometrical element and n is 2 or 3 (2D-plane figure or 3D-solid...

ungefär 8 år ago

Solved

Split a string into chunks of specified length
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

ungefär 8 år ago

Solved

Ordinal numbers
Given an integer n, return the corresponding ordinal number as a character string. For example, ord(1)='1st' ord(2)=...

ungefär 8 år ago

Solved

Permute diagonal and antidiagonal
Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

ungefär 8 år ago

Solved

sum of first 'n' terms
Given n=10, find the sum of first 'n' terms Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...

ungefär 8 år ago

Solved

Solving a quadratic equation
Given a, b ​​and c, Return the solution of the following quadratic equation: a*x^2 + b*x + c = 0.

ungefär 8 år ago

Solved

Remove entire row and column in the matrix containing the input values
Remove the entire row and column from the matrix containing specific values. The specified value can be a scalar or a vector. Fo...

ungefär 8 år ago

Solved

Convert Hard Drive marketing sizes to actual data sizes
Hard drive sizes are typically marketed using the decimal meaning of prefixes, whereas RAM uses binary meanings. For example: ...

ungefär 8 år ago

Solved

random picture with random colours
write a function which creates a random(x,y) matrix with random RGB colours for example create_pic(5,5) gives us a 3d matrix. ...

ungefär 8 år ago

Solved

Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...

ungefär 8 år ago

Solved

Wilf-Zeilberger pairs
Take as inputs two functions _F_ and _G_, and two scalar values _n_ and _k_. Test whether the functions are candidates to be a W...

ungefär 8 år ago

Solved

Matrix with different incremental runs
Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

ungefär 8 år ago

Solved

Create a matrix X, where each column is a shifted copy of the vector v
Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

ungefär 8 år ago

Solved

Snakes on a plane
Given the dimensions of a 2-d plane, create a matrix where a "snake" of ones occupies the plane from top left to bottom right. ...

ungefär 8 år ago