Resuelto


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

21 días hace

Resuelto


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

21 días hace

Resuelto


Make a run-length companion vector
Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

21 días hace

Resuelto


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

21 días hace

Resuelto


Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

21 días hace

Resuelto


Positive Infinity
Round the array a towards positive infinity

21 días hace

Resuelto


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

21 días hace

Resuelto


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

21 días hace

Resuelto


Tic Tac Toe FTW
Given a tic tac toe board: * 1 represents X * 0 represents empty. * -1 represents O It is X's move. If there is an imme...

21 días hace

Resuelto


Plot Damped Sinusoid
Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

21 días hace

Resuelto


Draw a '5' in a zero matrix!

21 días hace

Resuelto


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

21 días hace

Resuelto


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

21 días hace

Resuelto


Draw a '3' in a zero matrix!

21 días hace

Resuelto


Half?
If you toss an even number (x) of coins, what is the probability (y) of 50% head and 50% tail?

21 días hace

Resuelto


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

21 días hace

Resuelto


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the second...

21 días hace

Resuelto


Negative matrix
Change the sign of all elements in given matrix.

21 días hace

Resuelto


Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

21 días hace

Resuelto


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

21 días hace

Resuelto


Getting the row and column location from a matrix
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to get <http://www.mathwo...

21 días hace

Resuelto


love is an n-letter word
Given a list of *N words*, return the *N-letter word* (choosing one letter from each word) with the property of having the least...

21 días hace

Resuelto


Is the input divisible by 3?
Return true if the input is divisible by 3 and false if not.

21 días hace

Resuelto


Make a Palindrome Number
Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...

21 días hace

Resuelto


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

21 días hace

Resuelto


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

21 días hace

Resuelto


Sum! Sum! Sum!
Calculate the sum of the sequence up to nth term >> a,aa,aaa,aaaa,... 2,22,222,2222,... [for a=2]

21 días hace

Resuelto


Can the knight take out the pawn?
* position of knight = k * position of pawns = p can the knight take out those pawns? * k='Nf4' * p={'g6','g7'} then...

21 días hace

Resuelto


The Dark Knight
The current position of the knight is x The desired destination is y The size of the chessboard is n. Find the minimu...

21 días hace

Resuelto


King's Cage
Given the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination. ...

21 días hace

Cargar más