Community Profile

photo

nag


1.254 total contributions since 2016

nag's Badges

View all

Contributions in
View by

Solved


Calendar Matrix
Return a calendar matrix for the given values of month and year. Assume that Sunday is the first day of the week. The resulting ...

8 giorni ago

Solved


Rainbow matrix
Create a "rainbow matrix" as described in the following examples Input = 3 Output = [ 1 2 3 2 3 2 ...

8 giorni ago

Solved


count to vector
Return a matrix of numbers of dimension K by N, where K = prod(v), and N=length(v). The rows count from a vector of ones up to v...

8 giorni ago

Solved


Count from 0 to N^M in base N.
Return an array of numbers which (effectively) count from 0 to N^M-1 in base N. The result should be returned in a matrix, with ...

8 giorni ago

Solved


BULLSEYE Part 2: Reference Problem 18 BULLSEYE
Given n (always odd), return output a that has concentric rings of the 1s and 0s around the center point. Examples: Input ...

8 giorni ago

Solved


ZigZag matrix with reflected format
ZigZag MATRIX with REFLECTED format. We have only input x. We have to create a matrix in the following pattern. input n=5...

8 giorni ago

Solved


Matrix Construction I
Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

9 giorni ago

Solved


Find the average of a random sequance
Write a function that generates random integers within a loop, and calculates the mean of the positive numbers only. At each ...

9 giorni ago

Solved


Find best domino orientation
Given a list of pairs, find the orientation they should be placed in a line, such that the sum of the absolute values of the dif...

9 giorni ago

Solved


Find best placement for ordered dominoes (harder)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

9 giorni ago

Solved


Find perfect placement of non-rotating dominoes (easier)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

9 giorni ago

Solved


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

9 giorni ago

Solved


Consecutive Equation Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on the largest consecutive run of ...

9 giorni ago

Solved


Digital Neighbourhood
Given a natural number reorder its digits to create another number, closest to the given one. Examples: * 123 gives 132, ...

9 giorni ago

Solved


With apologies to William Blake
Coder Coder, typing fast Sitting at your desk, aghast. What immortal MATLAB script will solve this problem, nice and qu...

9 giorni ago

Solved


Big numbers, repeated least significant digits
This problem builds off of <http://www.mathworks.com/matlabcentral/cody/problems/3077-big-numbers-least-significant-digits/ Prob...

11 giorni ago

Solved


Big numbers, least significant digits
Given two numbers, x and n, return the last d digits of the number that is calculated by x^n. In all cases, d will be the number...

11 giorni ago

Solved


Find similar sequences
Another problem inspired by a question on the <http://www.mathworks.com/matlabcentral/answers answers> forum. Given a matrix ...

11 giorni ago

Solved


Largest Geometric Series
Extension of Ned Gulley's wonderful <http://www.mathworks.com/matlabcentral/cody/problems/317 Problem 317>. In a geometric se...

11 giorni ago

Solved


Back to basics 24 - Symbolic variables
Covering some basic topics I haven't seen elsewhere on Cody. Given a string algebraic expression, return the symbolic variabl...

12 giorni ago

Solved


arithmetic progression
I've written a program to generate the first few terms of <https://en.wikipedia.org/wiki/Arithmetic_progression arithmetic progr...

12 giorni ago

Solved


geometric progression
I've modified my <http://uk.mathworks.com/matlabcentral/cody/problems/2800-arithmetic-progression previous program> so that it n...

12 giorni ago

Solved


Approximation of Pi (vector inputs)
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

12 giorni ago

Solved


Generate Square Wave
Generate a square wave of desired length, number of complete cycles and duty cycle. Here, duty cycle is defined as the fraction ...

12 giorni ago

Solved


Find matching parenthesis
One of the most indispensable things about a great text editor for programming is the ability to quickly jump between matching p...

12 giorni ago

Solved


Calculate a modified Levenshtein distance between two strings
Inspired by the Cody problem found <http://www.mathworks.com/matlabcentral/cody/problems/93-calculate-the-levenshtein-distance-b...

12 giorni ago

Solved


Find mistyped words in text (mixed-up letters)
Mistyped words are a regular occurrence in emails, texts, status updates, and the like. Many times, people send or post a second...

12 giorni ago

Solved


Formatting currency numbers
Given a number, format it properly for textual display using the notation $xxx,xxx,xxx.xx. Assume that no more than two digits ...

13 giorni ago

Solved


Bang Bang in Bangalore
Imagine a strange language disorder, Bangolangosis, has developed among trigonometricians of <http://en.wikipedia.org/wiki/Banga...

13 giorni ago

Solved


English to Pig Latin Translator
Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin): ...

13 giorni ago

Load more