A résolu


Replace pattern 0 1 0 and 1 0 1
Find and replace a pattern in a row of zeroes and ones. * Find 1 0 1 and replace it with 1 1 1 * Find 0 1 0 and replace it w...

plus de 5 ans il y a

A résolu


Max Change in Consecutive Elements
If an array is given as input then find the index of consecutive elements that represent maximum change. Example: Input ...

plus de 5 ans il y a

A résolu


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

plus de 5 ans il y a

Problème


Parsing Expressions - Binary Arithmetic Operators I
Parse and evaluate expressions like these: '1 + 2' '51 - 78' '42 * 9' The only operators are +, -, *. Both argu...

plus de 5 ans il y a | 1 | 21 solveurs

A résolu


Find the longest match inside two strings
Given two strings, find the longest string which is contained within both strings. e.g. the longest string that is contained ...

plus de 5 ans il y a

A résolu


Reverse within string
If input is a string 'yellow' the output should be 'leywol'. Locate the middle of the string and reverse the first (yel) and sec...

plus de 5 ans il y a

A résolu


Block average ignoring NaN values
Given a matrix, calculate the block average of each disjoint sub-matrix while ignoring *NaN* values. Assume that the size of the...

plus de 5 ans il y a

A résolu


Block average
Given a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix alo...

plus de 5 ans il y a

A résolu


Crunch that matrix!
You are given an M x N matrix. Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms ...

plus de 5 ans il y a

A résolu


Matrix to 3-Column Matrix
Consider a matrix *A* such as A = [1 2 3 3 4 5 6; 2 3 4 5 6 7 8]; Can you convert this matrix to a three-column ...

plus de 5 ans il y a

A résolu


Moving Product (Easy)
Given an input array A, write a function *movprod(A,k,dim)* to calculate the moving product over a sliding window of length *k* ...

plus de 5 ans il y a

A résolu


Vector to 3-Column Matrix
Consider a vector *A* such as A = [1 2 3 3 4 5 6] Can you convert this vector to a three-column matrix like this: ...

plus de 5 ans il y a

A résolu


Cumulative maximum of an array
Find the cumulative maximum of an array without using the built-in function <http://www.mathworks.com/help/matlab/ref/cummax.htm...

plus de 5 ans il y a

A résolu


Cumulative minimum of an array
Find the cumulative minimum of an array without using the built-in function <http://www.mathworks.com/help/matlab/ref/cummin.htm...

plus de 5 ans il y a

A résolu


Divide elements by sum of elements
In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

plus de 5 ans il y a

A résolu


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

plus de 5 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...

plus de 5 ans il y a

A résolu


Iccanobif numbers 1
There are a lot of problems in Cody that deal with Fibonacci numbers (1, 1, 2, 3, 5, 8, 13, 21 etc...) so let's turn things arou...

plus de 5 ans il y a

A résolu


Fibonacci Decomposition
Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...

plus de 5 ans il y a

A résolu


How many Fibonacci numbers?
Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

plus de 5 ans il y a

A résolu


Find my daddy long leg (No 's')
Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.

plus de 5 ans il y a

A résolu


Is the Point in a Triangle?
Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...

plus de 5 ans il y a

A résolu


Calculate the centroid of a triangle
Info: https://en.wikipedia.org/wiki/Centroid Example Input: x = [0 0 1]; % x-coordinate y = [0 1 0]; % y-coordinat...

plus de 5 ans il y a

A résolu


Find the sides of an isosceles triangle when given its area and height from its base to apex
Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and ...

plus de 5 ans il y a

A résolu


Height of a right-angled triangle
Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a...

plus de 5 ans il y a

A résolu


Can we make a triangle?
Given three positive number, check whether a triangle can be made with these sides length or not. remember that in a triangle su...

plus de 5 ans il y a

A résolu


Pi Estimate 1
Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

plus de 5 ans il y a

A résolu


Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

plus de 5 ans il y a

A résolu


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

plus de 5 ans il y a

A résolu


Given a square and a circle, please decide whether the square covers more area.
You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

plus de 5 ans il y a

Charger plus