Solved


Find x rows where the sum of the numbers is the maximum
Find x rows where the sum of the numbers is the maximum. For example: when x is 2 and m is 2 3 5 0 2 3 5 5 6 0 9 4 then y =...

2 years ago

Solved


Draw a '1' in a zero matrix!

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

2 years ago

Solved


De-primed
Write a function that will multiply every prime number in the array or matrix by two, leaving all other numbers the same, and re...

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

2 years ago

Solved


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

2 years ago

Solved


Binary Neighbourhood
Given a natural number reorder its binary form to create another number, closest to the given one. Examples: * 1 gives 2, ...

2 years ago

Solved


Convert to Binary Coded Decimal
Convert from decimal representation to <http://en.wikipedia.org/wiki/Binary-coded_decimal Binary Code Decimal> (or BCD) represen...

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

2 years ago

Solved


Find out the Gray Code for a Given Binary Number
Find out <http://en.wikipedia.org/wiki/Gray_code Gray Code> for a given binary number Example Binary input 1000 Gray ...

2 years ago

Solved


Equation Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on times that include the four bas...

2 years ago

Solved


Power Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on times that represent powers. Fo...

2 years ago

Solved


Bit calculation
Give me the count of numbers from 1 to n having their last two bits as 0. For example function y = ret_count(4) y = x...

2 years ago

Solved


Big numbers, repeated least significant digits
This problem builds off of Problem 3077 Given an integer x which contains d digits, find the value of (minimum) n (n > 1) such ...

2 years ago

Solved


Pancake sorting - minimum flips.
Sort a stack of pancakes by flipping them using spatula. There are N pancakes with diameters 1:N. Spatula can be inserted anyw...

2 years ago

Solved


Pancake sorting
Sort a stack of pancakes by flipping them using spatula. * There are _N_ pancakes with diameters _1:N_. * Spatula can be ins...

2 years ago

Solved


How close to a hole
Suppose you have a description of good places (ones) and bad places (zeros). You want to know your distance from a bad place (in...

2 years ago

Solved


Find the distance between runs
Another question inspired by the <http://uk.mathworks.com/matlabcentral/answers/?s_tid=gn_mlc_an answers forum>: A vector of ...

2 years ago

Solved


Find Elements in Range
Based on a question on <http://www.mathworks.com/matlabcentral/answers/ MATLAB Answers>. Find all the elements of a vector wh...

2 years ago

Solved


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

2 years ago

Solved


Elements with highest local average
Input v is a row vector such that length(v)>3. Consider a sliding window of length 3 that is used to calculate the local average...

2 years ago

Solved


How to reverse spdiags?
The spdiags function extracts all nonzero diagonals from the m-by-n matrix A. So if A=[1 2 3;4 5 6;7 8 9], spdiags(A)=[7 4...

2 years ago

Solved


Find the same and successive values in a vector
Find the same and successive values in a vector. For example: Input x = [ 1 0 0 1 1 1 1 0 1 1 1 0 0 0 1 ] Start and end...

2 years ago

Solved


Longest Sequence of NaNs
In an array return the length of longest sequence of nans for each column. x = [ 2 3 1 2 5 6; nan nan 5 n...

2 years ago

Solved


Sum My Indices
Given inputs M and N (in that order), output an MxN matrix whose entries are equal to the sum of their indices. Example input...

2 years ago

Solved


Combine Data With Gaps
Combine data sets a and b where the datasets have "gaps" or unique points. Example: Input a = [1,0; 2,1; ...

2 years ago

Solved


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

2 years ago

Solved


Temperature Conversion Utility (Strings)
This is a follow-on problem to <http://www.mathworks.com/matlabcentral/cody/problems/2413-temperature-conversion-utility Problem...

2 years ago

Solved


Temperature Conversion Utility
There are a few problems on Cody regarding temperature conversion (C to K, C to F, F to C), but none include Rankine. Furthermor...

2 years ago

Solved


Converting Decimal to Binary
Given a decimal number that may include a fractional component, convert it into binary representation. The numbers you are given...

2 years ago

Load more