Solved


random picture with random colours
write a function which creates a random(x,y) matrix with random RGB colours for example create_pic(5,5) gives us a 3d matrix. ...

nästan 11 år ago

Solved


Create matrix of replicated elements
Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. Example: Input: ...

nästan 11 år ago

Solved


kmph to mps
convert kilometer per hour to meter per second

nästan 11 år ago

Solved


Given a 4x4 matrix, swap the two middle columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

nästan 11 år ago

Solved


Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.

nästan 11 år ago

Solved


Number of toolboxes?
Return a number equal to the number of toolboxes available to the Cody solvers.

nästan 11 år ago

Solved


Generate N equally spaced intervals between -L and L
Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

nästan 11 år ago

Solved


N-Queens Checker
Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix,...

nästan 11 år ago

Solved


Return the 'Size' of a String of Code
One of the most 'mysterious' parts of playing Cody is the sizing system. Given a string of commands, return the size that Cody w...

nästan 11 år ago

Solved


the return of the hackathon
You might have found a solution to our <http://www.mathworks.com/matlabcentral/cody/problems/205-hackathon-the-beginnings previo...

nästan 11 år ago

Solved


Construct a string from letters and counts
Given two input arrays like this: [5,3,1] ['a','b','c'] Output a string that contains each letter the specified num...

nästan 11 år ago

Solved


Remove white space from the string
Remove the white spaces (trailing and leading) from the input variable

nästan 11 år ago

Solved


Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

nästan 11 år ago

Solved


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

nästan 11 år ago

Solved


Multiply 2 numbers
Very easy, you just have to multiply 2 numbers but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...

nästan 11 år ago

Solved


Choose the best fitting dominoes
You will be given a cell array of nx2 matrices. Choose one row from each matrix. These are the ordered pairs that will be plac...

nästan 11 år ago

Solved


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...

nästan 11 år ago

Solved


Say something funny
Say something funny, or not. Your solution will be (fully automatically and objectively) scored based on how clever or funny ...

nästan 11 år ago

Solved


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

nästan 11 år ago

Solved


Back to basics 2 - Function Path
Covering some basic topics I haven't seen elsewhere on Cody. Given a string that is the name of a MATLAB function, return a s...

nästan 11 år ago

Solved


"mirror" matrix
Create n x 2n "mirror" matrix of this type: e.g. for n = 2 m = [1 2 2 1;1 2 2 1] e.g. for n = 3 m = [1 2 3 3 2 1...

nästan 11 år ago

Solved


Count up then down
Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

nästan 11 år ago

Solved


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

nästan 11 år ago

Solved


Find best domino orientation
Given a list of pairs, find the orientation they should be placed in a line, such that the sum of the absolute values of the dif...

nästan 11 år ago

Solved


Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

nästan 11 år ago

Solved


Find the "ordinary" or Euclidean distance between A and Z
A, B and Z define three points in the 3D _Euclidean_ space of the form: A = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z]; Find th...

nästan 11 år ago

Solved


N-Cards Problem
You have a deck of _N_ cards numbered in order from 1 to _N_. You discard the top card (card 1) and place the next card (card 2)...

nästan 11 år ago

Solved


High school cafeteria
Given an input vector of positive integers, return a row vector with the primes first (in increasing order) and the composites n...

nästan 11 år ago

Solved


Getting the absolute index from a matrix
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to get the <http://www.ma...

nästan 11 år ago

Solved


Output any real number that is neither positive nor negative
Output any real number that is neither positive nor negative

nästan 11 år ago

Load more