Solved

That's some divisor you've got there...

Given a positive integer x, calculate the sum of all of the divisors of the number. Please include the number itself in your fi...

fast 8 Jahre ago

Solved

Back to basics 17 - white space

Covering some basic topics I haven't seen elsewhere on Cody. Remove the trailing white spaces from the input variable

fast 8 Jahre ago

Solved

Distance walked 3D

suppose you go from x-y-z coordinates [3,4,2] to [0,0,2] to [0,1,2] to [1,1,2], to [1,1,20] then you walked 25 units of distance...

fast 8 Jahre ago

Solved

GJam 2013 Veterans: Hedge

This Challenge is derived from <http://code.google.com/codejam/contest/2334486/dashboard Hedgemony>. This is the Large data set ...

fast 8 Jahre ago

Solved

Remove the polynomials that have positive real elements of their roots.

The characteristic equation for a dynamic system is a polynomial whose roots indicate its behavior. If any of the <http://www.ma...

fast 8 Jahre ago

Solved

How many trades represent all the profit?

Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

fast 8 Jahre ago

Solved

Smith numbers

Return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at <http://en.wikipedi...

fast 8 Jahre ago

Solved

Unit Matrix

Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

fast 8 Jahre ago

Solved

Find the position of last minimum value in an integer array with numbers

If x = [2 6 4 9 -10 3 1 5 -10] then the output should be 9, because last minimum value (-10) lies at the 9th position.

fast 8 Jahre ago

Solved

Find the position of first minimum value in an integer array with numbers

If x = [2 6 4 9 10 3 1 5 1] the the output should be 7, because the first minimum value (1) lies at the 7th position.

fast 8 Jahre ago

Solved

Axis colors of matlab created PNG changes after saving in Powerpoint

Hi everybody, i'm post-processing data with MatLab saving the images in the png format. I tried both ways saving the images: ...

fast 8 Jahre ago

Solved

Find the maximum two numbers of every column of a matrix

Find the maximum two numbers of every column of a matrix. Example: If we input a matrix A = [ 1 2 4 6 0 3 ...

fast 8 Jahre ago

Solved

Create a two dimensional zero matrix

You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

fast 8 Jahre ago

Solved

Set the array elements whose value is 13 to 0

Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

fast 8 Jahre ago

Solved

Circle area using pi

Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

fast 8 Jahre ago

Solved

Back to basics 20 - singleton dimensions

Covering some basic topics I haven't seen elsewhere on Cody. Remove the singleton dimensions from the input variable (e.g. if...

fast 8 Jahre ago

Solved

Create a v-notch vector without "sort" function

Given a vector vec, create a v-shaped vector as shown below: vec = [ 10 2 3 89 5 7 90 0 12] ...

fast 8 Jahre ago

Solved

It dseon't mettar waht oedrr the lrettes in a wrod are.

An internet meme from 2003 (read more <http://www.snopes.com/language/apocryph/cambridge.asp here>) asserted that readers are re...

fast 8 Jahre ago

Solved

Find state names that end with the letter A

Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...

fast 8 Jahre ago

Solved

Simple equation: Annual salary

Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

fast 8 Jahre ago

Solved

Returning a "greater than" vector

Given a vector, v, return a new vector , vNew, containing only values > n. For example: v=[1 2 3 4 5 6] n=3 vNew =...

fast 8 Jahre ago

Solved

Local Minima

Given a vector of data x, find the values of local minimum that is smaller than its neighbor elements. For example, if x =...

fast 8 Jahre ago

Solved

Too Many Zeros, Dump Them!

Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

fast 8 Jahre ago

Solved

Convert a Cell Array into an Array

Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

fast 8 Jahre ago

Solved

Index one element in each vector of an array along a given dimension

Functions like min and max can return in their second output argument the index of the element in each vector along a particular...

fast 8 Jahre ago

Solved

Count ones

Write a program to count number of ones (1s) in an integer variable input. For example: Input x=2200112231 output y=3 I...

fast 8 Jahre ago

Solved

Project Euler: Problem 7, Nth prime

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

fast 8 Jahre ago

Solved

Is A the inverse of B?

Given a matrix A and a matrix B, is A the inverse of B? >>A=[2,4;3,5]; >>B=[-2.5,2;1.5,-1]; >>isInverse...

fast 8 Jahre ago

Solved

GJam 2014 China Rd A: Library Sorting (Large)

This Challenge is derived from <http://code.google.com/codejam/contest/2924486/dashboard#s=p2 GJam 2014 China Sorting>. Subset ...

fast 8 Jahre ago