A résolu


Give a matrix that matches itself when rotated
Given n and s, return a n-by-n matrix a of integers such that sum(sum(a == rot90(a))) is equal to exactly s. The integer...

27 jours il y a

A résolu


Encoding Google Maps Polylines
This problem is based on the Google Polyline Encoder algorithm. This is how Google Maps encodes a line for display on a map. You...

27 jours il y a

A résolu


Get to a number faster.
If you start with $1 and, with each move, you can either double your money or add another $1, what is the smallest number of mov...

27 jours il y a

A résolu


Quine : write a quine in MATLAB
Quine is a type of program whose output matches the source code. See: <https://en.wikipedia.org/wiki/Quine_(computing) Quine in...

27 jours il y a

A résolu


Play Games of Beggar My Neighbor
Beggar my neighbor, as it is most commonly referred to, is a simple deterministic card game. A standard 52 card deck is shuffled...

27 jours il y a

A résolu


Compute the comma transform of an integer sequence
Consider the sequence formed by the multiples of 19: 19, 38, 57, 76, 95, 114, 133, 152, 171, 190, 209, 228,… A new sequence ca...

27 jours il y a

A résolu


Convert sorting indices to ranks

28 jours il y a

A résolu


Fast Fourier transform algorithm
Your task is to implement the Fast Fourier transform algorithm, without using builtin MATLAB fft commands e.g. fft, fft2, or har...

28 jours il y a

A résolu


Find the centre of an arc and its radius
Given two points on an arc (x0,y0) and (x1,y1) and the angle between them, alpha. Return the centre of the circle and the radiu...

28 jours il y a

A résolu


X O X Oh!
_This follows on from problem 44850 - X O X O_ <https://www.mathworks.com/matlabcentral/cody/problems/44850-x-o-x-o> On a...

28 jours il y a

A résolu


Moving Median Absolute Deviation
The median absolute deviation (MAD) is defined as MAD = median(abs(A − median(A))) for a rolling window of length n. For examp...

28 jours il y a

A résolu


Writing Error Messages
Well written functions check inputs to make sure the input is valid. The function ErrorCheck takes three arguments: * a - a s...

28 jours il y a

A résolu


Exact binary matrix factorization
Given a binary-valued (only ones and zeroes) MxN matrix C, and K (where K<M and K<N) find a binary-valued MxK matrix A and a bin...

28 jours il y a

A résolu


rot45 : a different aproach
Inspired by problem 1840. http://www.mathworks.com/matlabcentral/cody/problems/1840-rotate-matrix-clockwise-45-degree Given an...

28 jours il y a

A résolu


Design matrix from eigenvalues
Write a function that takes one input argument n and outputs a (n x n) square matrix A with the following properties: -A has...

28 jours il y a

A résolu


Mix it up!
Given an input string S, return a new string B, that is created by taking one character from the front and then the end iterativ...

28 jours il y a

A résolu


Check if integer is a prime number
Check if integer i is a prime number. Returns logical true '1' if it is.

28 jours il y a

A résolu


Find the repeating decimal pattern!
Write a function that takes one double input value and returns only the repeating decimal, if any, as a string. Only decimals f...

29 jours il y a

A résolu


Circle and Quadratic
Imagine the quadratic curve with equation y=y(x)=ax^2+bx+c On the concave side of this curve there is a circle of radius...

29 jours il y a

A résolu


Remove TeX from string
Matlab’s TeX support in figure windows is great for displaying information in a visually appealing way. However, many of the TeX...

29 jours il y a

A résolu


Pixel density
<https://en.wikipedia.org/wiki/Pixel_density Pixel density> tells us how many pixels we can find within a unit of length. And a...

29 jours il y a

A résolu


Create the Ulam spiral
Have you ever seen this wonderful spiral ? The Ulam Spiral is arranging prime numbers in a clockwise spiral starting in 0. Give...

29 jours il y a

A résolu


Wavy gravity
In a parallel universe the gravity works very strangely. Indeed, gravity is equal to: g = sin( (pi/2)*t/60 ) [m/s^2], where t i...

environ un mois il y a

A résolu


Who am I ?
Who am I ? Write any function that reveals itself under these constraints. Hint: I am combinatorial code, and I don't like stat...

environ un mois il y a

A résolu


Beat the RNG - EASY

environ un mois il y a

A résolu


LIFO Validation
Write a function to check whether a LIFO (Last In First Out) restriction on inventory is violated. We have two input vectors ...

environ un mois il y a

A résolu


Create nXn Fourier matrix

environ un mois il y a

A résolu


Higher! Lower! Correct!
In he game of "Guess the number", the game leader mentally pictures a number between a lower and higher number, and then asks th...

environ un mois il y a

A résolu


Check if an FAA N-Number is Valid
An N-number is a unique registration assigned by the Federal Aviation Administration (FAA) to every civil aircraft operating in ...

environ un mois il y a

Charger plus