解決済み


Integer Persistence, Product
Let's construct a sequence as follows: is a given natural number, and is the product of the digits of . The persistence of i...

18日 前

解決済み


Functional inputs
Return an n-dimensional array whose elements are the results of a function over a set of vectors. The (i,j,k, ...n)th element...

18日 前

解決済み


Solve for factorial of X
It gives you the number x, and set y equal to x factorial. Ex. There are 52 cards in a deck, each specific order of all 52 car...

18日 前

解決済み


Calculate Drag Force
Write a MATLAB function to compute the drag force on an object moving through air: ​ where: D is drag force (N) ρ is air de...

18日 前

解決済み


String count
given a string 'str', count the number of the followings - * letters * digits * white space * capital letters * smal...

18日 前

解決済み


Rotate a matrix without using rot90
rotate the input square matrix by certain degrees (e.g. 270 or 450 etc.) without using rot90 or flip function. its an extension...

18日 前

解決済み


another bullseye
create matrix like below -- for x=2, y=[1 1 1 1 1; 1 2 2 2 1; 1 2 3...

18日 前

解決済み


What time can I drive after drinking?
At T o'clock, after a hard day of Matlab, I immediately start drinking and treat myself to N pints of tasty beer. Each beer I dr...

18日 前

解決済み


Seperate array to small section according to its index position
Given a integer n, we can generate a sequence [0,1,2,3,4,..., 2^n-1], then we separate it to two sequence according to their ind...

18日 前

解決済み


AK Sorting according to given order
Conventional ascending order of one digit number is [ 0, 1, 2, ......9]. Now this order is changed and stored in vector a. For e...

18日 前

解決済み


En passant - 01
This is white's turn. The player moves his pawn. The pawn's previous and current positions are given. Determine whether th...

18日 前

解決済み


chess position
given the position of a chess piece in algebric notation, convert it into 8 by 8 matrix format. For example, * 'Qd5' >> [3,4]...

18日 前

解決済み


Castling-03
Given the position of different chess pieces on the chessboard, figure out whether castling is valid or not in the next move (wh...

18日 前

解決済み


Castling-02
This is a follow up of problem <https://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01> Given...

18日 前

解決済み


Castling-01
Given the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or no...

18日 前

解決済み


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

18日 前

解決済み


Checkmate-02
This is an extension of the problem <https://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate> If the king is in...

18日 前

解決済み


Checkmate
* The positions of different chess pieces are given in a cell *p* . * The position of the king is given as *x* Determine i...

18日 前

解決済み


Queen's move - 02
In continuation with the problem-45236 ... In the previous problem, it was assumed that there were no other chess pieces on th...

18日 前

解決済み


Queen's move
given a number of consecutive moves of queen, check for their validity based on their previous position.... but remember if u g...

18日 前

解決済み


Knight's Watch
"Night gathers, and now my watch begins" A knight is placed on an n-by-n sized chessboard at the position x. Find the proba...

18日 前

解決済み


Get Cody's screen size
Return an object that helps this problem's test suite return Cody's screen size.

19日 前

解決済み


ZigZag - 05
Given a matrix, print all its elements in the alpha form. For example - a=[16 2 3 13 5 11 10 8 ...

19日 前

解決済み


Exhaust all possible logical vectors
Input a length argument and list all possible logical vectors of that length. My solution is of size 29. Can you find an even s...

19日 前

解決済み


How many ways?
Create a program to determine in how many ways can a regular n-gon be divided into n-2 triangles?

19日 前

解決済み


Ugly numbers - 02
Ugly numbers are those whose prime factors are 2, 3 or 5. find the nth ugly number. n.b. unlike the previous problem,trivi...

19日 前

解決済み


Is the test point on the line segment?
Given the [x,y,z] coordinates for the three points pa, pb, and pc, return true if the test point pc is on the line segment with ...

19日 前

解決済み


Check if vertices form a rectangle
Given a set of 4 vertices defined by vectors X and Y, return true if the vertices form a rectangle and false otherwise. X and Y...

19日 前

解決済み


GJam 2011 Africa Qualifier C: House, maximum area rectangle
This Challenge is derived from <http://code.google.com/codejam/contest/837485/dashboard#s=p2 GJam 2011 Africa: Building a House>...

19日 前

解決済み


Reassign cell contents to empty variables, preserving cell content data type
Given a cell array C, return a cell array D with the following specifications: 1. D has the same size as the input C. 2. E...

19日 前

さらに読み込む