Solved

Colon operator of two vectors

You are given two vectors of equal length: VecStart, VecEnd Each vector contain a set of integers, where VecEnd(j)>=VecStar...

oltre 7 anni ago

Solved

Top of the Hour : Return from your routine within 1 second of the hour

*Top of the Hour* Submit your routine such that it returns to Cody after the hour and within 1 second of the hour. The tes...

oltre 7 anni ago

Solved

Equal to their cube

Tell me three real numbers that are equal to their cubes?

oltre 7 anni ago

Solved

Subtract two positive numbers

Given a and b as a string, return b-a without using string to number conversion functions. a and b must to be a same size and b ...

oltre 7 anni ago

Solved

Knights and Knaves (part 3)

_This is a Matlab adaptation of the_ <http://en.wikipedia.org/wiki/Knights_and_Knaves Knives and Knaves> _logical puzzles_. ...

oltre 7 anni ago

Solved

Knights and Knaves (part 2)

_This is a Matlab adaptation of the_ <http://en.wikipedia.org/wiki/Knights_and_Knaves Knives and Knaves> _logical puzzles_. ...

oltre 7 anni ago

Solved

Knights and Knaves (part 1)

This is a Matlab adaptation of the <http://en.wikipedia.org/wiki/Knights_and_Knaves Knights and Knaves> logical puzzles. You ...

oltre 7 anni ago

Solved

Make a KITT-scanner on the command line

Did you know that you can actually remove characters from the command-line window? Just send a 'backspace' character to the outp...

oltre 7 anni ago

Solved

Make an awesome ramp for a tiny motorcycle stuntman

Okay, given a vector, say v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 3 6 9 11 0; 6 9 ...

oltre 7 anni ago

Solved

The Answer to Life, the Universe, and Everything

A variation of a previous Hitchhiker's Guide to the Galaxy problem. *Inputs:* Life, the Universe, and Everything *Output:*...

oltre 7 anni ago

Solved

Sort (high on middle, low on ends)

Sort the vector of numbers in order low-high-low. Even numbers appear in ascending order on the left and odd numbers appear in d...

oltre 7 anni ago

Solved

I've got the power! (Inspired by Project Euler problem 29)

Consider all integer combinations of a^b and b^a for the integer values 2 ≤ a ≤ 4 and 2 ≤ b ≤ 5: 2^2=4, 2^3=8, 2^4=16,...

oltre 7 anni ago

Solved

The Birthday Phenomenon

First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

oltre 7 anni ago

Solved

You LOVES Matlab 41%

Given two strings, determine the percentage that one loves the other in the following way: YOU LOVES MATLAB there is 1 '...

oltre 7 anni ago

Solved

How many days does the cat take to climb out of the hole?

A cat accidentally falls down a hole with sloping but rough sides. It can climb out of the hole of height h metres, but for ever...

oltre 7 anni ago

Solved

Volume of this donut

Given hole diameter a, and outermost diameter b, determine the volume y of the resulting donut.

oltre 7 anni ago

Solved

Create incrementing array

Given a and b generate an output matrix as shown in following examples: a=2 b=5 output=[2 20 200 2000 20000] a=4 b...

oltre 7 anni ago

Solved

Ripping numbers apart!

So you have to "rip" a number apart into individual digits... The end output is a cell. That is if: x = 12345678 o...

oltre 7 anni ago

Solved

Replace multiples of 5 with NaN

It is required to replace all values in a vector that are multiples of 5 with NaN. Example: input: x = [1 2 5 12 10 7] ...

oltre 7 anni ago

Solved

Numeric array to cell array of strings (easy)

Given a numeric array (A) and a 1xk cell array of strings (C), return a cell array (B) that is the same size as A and in which e...

oltre 7 anni ago

Solved

Factorial !

Calculate the factorial of a non-negative integer without using the built in function *factorial*

oltre 7 anni ago

Solved

Create a cell array out of a struct

Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

oltre 7 anni ago

Solved

Back to basics 13 - Input variables

Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

oltre 7 anni ago

Solved

Knight's Tour Checker

Given a matrix a, determine whether or not a legal <http://en.wikipedia.org/wiki/Knight's_tour knight's tour> is present. The kn...

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

oltre 7 anni ago

Solved

Distance walked 2D

Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

oltre 7 anni ago

Solved

Vectorize the digits of an Integer

Create a vector of length N for an integer of N digits. x=123045; x_vec=[1 2 3 0 4 5]; I happened upon a trick to do ...

oltre 7 anni ago

Solved

Matrix which contains the values of an other matrix A at the given locations.

If you have two matrices, which together give xc and yc coordinates into another matrix, eg : xc = [1 1 1; 2 2 1]; ...

oltre 7 anni ago

Solved

Return elements unique to either input

Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

oltre 7 anni ago

Solved

Find the peak 3n+1 sequence value

A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

oltre 7 anni ago