A résolu


Divisible by 3
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

plus de 10 ans il y a

A résolu


Divisible by 2
This is the first problem in a set of "divisible by x" problems. You will be provided a number as a string and the function you ...

plus de 10 ans il y a

A résolu


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. ...

plus de 10 ans il y a

A résolu


Average valid values of arrays
Given a 1D array (column or row vector), compute the average of valid values. Valid values are defined via two thresholds: minVa...

plus de 10 ans il y a

A résolu


Square a Number
Given an input x, return y, which is equal to the square of x.

plus de 10 ans il y a

A résolu


Min by mean
Substitute the minimum value in each row of a matrix A by the mean of that row (it should also work if the input is a vector)

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


GJam 2015 Rd1B: Counter Culture
This Challenge is derived from <https://code.google.com/codejam/contest/8224486/dashboard#s=p0 GJam 2015 Rd 1B: Counter Culture>...

plus de 10 ans il y a

A résolu


GJam 2015 Rd1B: Noisy Neighbors
This Challenge is derived from <https://code.google.com/codejam/contest/8224486/dashboard#s=p1 GJam 2015 Rd 1B: Noisy Neighbors>...

plus de 10 ans il y a

A résolu


A quadrant matrix
Write a function called quadrants that takes as its input argument a scalar integer named n. The function returns Q, a 2n-by-2n ...

plus de 10 ans il y a

A résolu


Write a function man that takes a row vector v and returns a matrix H as follows..
Write a function called man that takes a row vector v as an input and returns a matrix H whose first column consist of the eleme...

plus de 10 ans il y a

A résolu


Evened up (or not)
You will be provided with an array or matrix that contains various numbers, in addition to an evening variable, e, set to 1 or 0...

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


Repeat The Components of Matrix
Repeat The components of a matrix so that the size of the output matrix is double to input matrix and components are repeated ne...

presque 11 ans il y a

A résolu


Calculate square and cube of number
Calculate square and cube of number x

presque 11 ans il y a

A résolu


factorial of a number x
Factorial of a number x

presque 11 ans il y a

A résolu


Determine if a row vector has NaN
Determine if a row vector x has NaN

presque 11 ans il y a

A résolu


Return fibonacci sequence do not use loop and condition version 3
Calculate the nth Fibonacci number,return sequence Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... ...

presque 11 ans il y a

A résolu


Compare two input matrices
Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0". Exa...

presque 11 ans il y a

A résolu


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

presque 11 ans il y a

A résolu


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

presque 11 ans il y a

A résolu


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

presque 11 ans il y a

A résolu


Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

presque 11 ans il y a

A résolu


summation of the reciprocals
Determine the summation of the reciprocals of numbers with length equal to N,in the meanwhile there is a digit K excluded from t...

presque 11 ans il y a

A résolu


Rotate counterclockwise a matrix 90 deg with left-bottom element
Example: Input [ 1 2 3 4 5 6 ] Output [ 3 6 2 5 1 4 ]

presque 11 ans il y a

A résolu


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

presque 11 ans il y a

A résolu


Given a number between 1-365 (a day number in a non leap year) , find what day of what month it is.
For a given number between 1-365 (a day number in a non leap year), you should check which day of which month it is. for exam...

presque 11 ans il y a

A résolu


(Linear) Recurrence Equations - Generalised Fibonacci-like sequences
This problem is inspired by problems <http://uk.mathworks.com/matlabcentral/cody/problems/2187-generalized-fibonacci 2187>, <htt...

presque 11 ans il y a

A résolu


Gold Standard
Gold has long been used as currency and a standard for currency, due to its inherent value and rarity. Historical data for gold ...

presque 11 ans il y a

A résolu


Sum of odd numbers in a matrix
Find the sum of all the odd numbers in a matrix. Example x = [2 3 5 7 1 4 11] y = 27

presque 11 ans il y a

Charger plus