해결됨


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

약 1년 전

해결됨


Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...

약 1년 전

해결됨


"mirror" matrix
Create n x 2n "mirror" matrix of this type: Examples For n = 2 m = [ 1 2 2 1 1 2 2 1 ] For n = 3 m = ...

약 1년 전

해결됨


Square root of number
Square root of given number.

약 1년 전

해결됨


Perfect Square or not
find Given input x is perfect square or not,if yes then output y=1.else y=0

약 1년 전

해결됨


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

약 1년 전

해결됨


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

약 1년 전

해결됨


Power supply: 230V to 115V
The problem is simple: we have a wall outlet which supplies 230V and an apparatus that requires 115V. Software is always chea...

약 1년 전

해결됨


Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.

약 1년 전

해결됨


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

약 1년 전

해결됨


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

약 1년 전

해결됨


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]; ...

약 1년 전

해결됨


Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

약 1년 전

해결됨


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

약 1년 전

해결됨


Matrix to column conversion
Given a matrix of any size, convert it into a column vector. e.g A=[10 20 30; 40 50 60] then, B = [10; 40; ...

약 1년 전

해결됨


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

약 1년 전

해결됨


Create a Matrix of Zeros
Given an input x, create a square matrix y of zeros with x rows and x columns.

약 1년 전

해결됨


Square a Number
Given an input x, return y, which is equal to the square of x.

약 1년 전

해결됨


Remove the Zero
Given an array n, remove all zeros

약 1년 전

해결됨


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

약 1년 전

해결됨


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...

약 1년 전

해결됨


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

약 1년 전