Gelöst


Find indices of diagonal elements
Given a matrix A and a diagonal index d (where 0 indicates the main diagonal and off-diagonals are identified by positive and n...

fast 12 Jahre vor

Gelöst


Juggling
There is a notation system for <http://en.wikipedia.org/wiki/Juggling jugglers> called <http://en.wikipedia.org/wiki/Siteswap si...

fast 12 Jahre vor

Gelöst


expand intervals vol.2
Similar to problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528>. This is a more general case, when bounds ...

fast 12 Jahre vor

Gelöst


Path of least resistance - Move all direction
Extension of the wonderful <https://www.mathworks.com/matlabcentral/cody/problems/1049-path-of-least-resistance Problem 1049> (P...

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


compress sequence into intervals
You're given a row vector of monotonically increasing integers most of which are consecutive. Find the upper and lower bounds of...

fast 12 Jahre vor

Gelöst


Eight queens puzzle
The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each ot...

fast 12 Jahre vor

Gelöst


Find the Next Legal Move in Reversi
<http://en.wikipedia.org/wiki/Reversi Reversi>, also known as Othello, is a game in which reversible white/black chips are place...

fast 12 Jahre vor

Gelöst


longest common semi-substring
Finding longest common substring is a common problem in string processing. This problem is a variant of that. Two strings are...

fast 12 Jahre vor

Gelöst


Solving Quadratic Equations (Version 1)
Quadratic equations have the form: ax^2 + bx + c = 0. Example: x^2 + 3x + 2 = 0, where a = 1, b = 3, and c = 2. The equation has...

fast 12 Jahre vor

Gelöst


Genome decoding
Inspired by a question on the answer forum: You are given a matrix of 8-bit integers which encodes a genome. Each integer can...

fast 12 Jahre vor

Gelöst


Wind Chill Computation
On a windy day, a temperature of 15 degrees may feel colder, perhaps 7 degrees. The formula below calculates the "wind chill," i...

fast 12 Jahre vor

Gelöst


Find the first N zeros of the 666 function
Using the following definition of the 666 function for this problem: _f(n)=sin('nnn')-cos(n*n*n)_, write a function that returns...

fast 12 Jahre vor

Gelöst


Distance between two GPS Coordinates
A problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GI...

fast 12 Jahre vor

Gelöst


Airline Ticket Mod7 Checksum
There are 13 digits in an airline ticket number. If an airline ticket number is valid, the 13th digit should be the remainder of...

fast 12 Jahre vor

Gelöst


Whole Number Un-Concatenator
Write a function that accepts an integer and an index digit and returns a vector containing two integers which are the leading a...

fast 12 Jahre vor

Gelöst


Must be in the front row...
You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...

fast 12 Jahre vor

Gelöst


Factorions: Numbers that equal the sum of the factorials of their digits
From Wikipedia: _A factorion is a natural number that equals the sum of the factorials of its decimal digits_ For example: ...

fast 12 Jahre vor

Gelöst


Create all combinations of vectors
This function exists in the Neural Network Toolbox but is not available in Cody. Can you write such a function? See <http://...

fast 12 Jahre vor

Gelöst


Create Combination
Motivation: In many problems, we need to create combinations with the function nchoosek. In some cases, however, choices are lim...

fast 12 Jahre vor

Gelöst


How long until the weekend?
Write a function a that takes a date vector as an input and returns the number of hours until the weekend begins. The beginning...

fast 12 Jahre vor

Gelöst


Mongean Shuffle : 2
Extension to problem 2479 ( <https://www.mathworks.com/matlabcentral/cody/problems/2479-mongean-shuffle> ) Determine the numb...

fast 12 Jahre vor

Gelöst


Mongean Shuffle
A Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side. * The top card of the deck is...

fast 12 Jahre vor

Gelöst


Cat, Meowcat and Concatenation
Input is a cell array containing several strings. Find the largest continuous sub-string common to all strings. All strings are ...

fast 12 Jahre vor

Gelöst


Calculate the h-index
H-index is a powerful tool for quantifying the scientific contribution of a researcher. H-index is defined as follows (source - ...

fast 12 Jahre vor

Gelöst


Graph Algorithms - 1 : Length of the largest closed path
An undirected simple graph is given as the form of an adjacency matrix. Find the length of the largest closed path (one that sta...

fast 12 Jahre vor

Gelöst


Graph Algorithms - 2 : Chromatic Number
Chromatic number of a graph is the minimum number of distinct colors required to color all the vertices of the graph such that n...

fast 12 Jahre vor

Gelöst


Sum of Dividend Digits
Find the smallest number that consist of only number 1's (e.g. 11111111111) which satisfy a given divisor and remainder. Then re...

fast 12 Jahre vor

Gelöst


Square Diagonal
If n is the given number, then make a diagonal matrix of size 2*2 with the square of that number.

fast 12 Jahre vor

Gelöst


Diagonal of a Spiral Matrix
Write a function that will return same output as diag(spiral(n)). The only exception is that spiral and diag functions are not a...

fast 12 Jahre vor

Mehr laden