Community Profile

photo

nag


1.262 total contributions since 2016

nag's Badges

View all

Contributions in
View by

Solved


Create a block diagonal matrix
A block diagonal matrix is a square matrix that can be written as A = [a 0 0 0 0 b 0 0 0 0 c 0 ...

6 Monate ago

Solved


Toeplitz Matrix
For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

6 Monate ago

Solved


The Matrix Construction
Given two input ,first one is CN (Column Number), Second one is Dim Can you produce such a matrix for example CN=6; Dim=2 ...

6 Monate ago

Solved


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

6 Monate ago

Solved


Numbers spiral diagonals (Part 2)
Inspired by Project Euler n°28 and 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the righ...

6 Monate ago

Solved


Numbers spiral diagonals (Part 1)
Inspired by Project Euler n°28 et 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...

6 Monate ago

Solved


Triangular matrices in 3D array
Given a 3D numeric array _x_, return an array _y_ of the same size in which all entries to the right of the main diagonal are ze...

6 Monate ago

Solved


Pascal's pyramid
In Pascal's triangle each number is the sum of the two nearest numbers in the line above: 1 1 1 ...

6 Monate ago

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

6 Monate ago

Solved


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

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

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

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

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

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

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

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

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

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

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

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

6 Monate ago

Solved


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

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

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

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

6 Monate ago

Solved


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

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

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

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

6 Monate ago

Solved


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

6 Monate ago

Load more