Solved

Verify Law of Large Numbers

If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

10 months ago

Solved

Simple spirometer - find your lung capacity from the number and size of soap bubbles in one breath

Assumed that each bubble has practically the same diameter d. Given total number n of bubbles. Find volume v of breath.

1 year ago

Solved

Minimum possible M of the maximum side of a triangle of given area A.

Suppose a triangle has area A. Suppose it has three sides S1, S2, and S3. Suppose M = max([S1 S2 S3]). What is the minimum po...

1 year ago

Solved

Probability of red tulips

I hope to give you bulbs of tulip. But I do not know the color of those petals. I just know that the color is red, white or yell...

1 year ago

Solved

Calculate the square of a number (Super Easy)

The goal is to calculate the square (y) of a number (x). Good way to start MatLab for beginners.

1 year ago

Solved

Add 3 numbers

In this problem, you have to add three numbers a, b and c. Give output d = add(a,b,c)

1 year ago

Solved

String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array

<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

1 year ago

Solved

Rearrange the given matrix to have all its zeros climb up to the top of each column - using for loops.

Given a matrix x, *using loops only* return a matrix y, in which all the zeros have "climbed" up to the top. That is, any zeros ...

1 year ago

Solved

Given a matrix A return a vector of the product of the elements in each column using a loop without using prod.

--------------------- for m: 3 1 3 3 10 1 9 1 9 4 1 4 5 6 5 ...

1 year ago

Solved

Given a matrix A (size m x n) create a matrix B (size m+2 x n+2) which consists of matrix A surrounded by zeros. See Example below:

A = [1 2 3 4 5 6] ----------- B = [0 0 0 0 0 0 1 2 3 0 0 4 5 6 0 0 0 0 0 0]

1 year ago

Solved

Given a matrix A (size m x n) create a matrix B which consists of matrix A sorted in descending order by columns and then by rows.

--------------- A= [ 2 6 -3 7 12 0 -12 5 1] --------------- B= [12 7 1 6 2 0 5 -3 ...

1 year ago

Solved

Given a Vector v1, create v2 which is the sum of each two adjacent elements in v1. {length(v2)=length(v1)-1}

if v1 is [1 2 3 4 5 6 7 8] then v2 should be [3 5 7 9 11 13 15]. if v1 is [1; 3; 5; 7] the...

1 year ago

Solved

Unique: Faster for options 'rows' and 'stable' for large array of uint8

Challenge: Execute unique(a,'rows','stable') Faster for 'a' being uint8. The "unique" function for the 'rows' and 'stable' o...

1 year ago

Solved

Create tangent function out of cosine only

Please don't use tangent and sine functions

1 year ago

Solved

Relative points in 2D: problem 1

The 2D pose of a robot, with respect to a world coordinate frame {O}, is described by a 3x3 homogenous transform matrix T. A la...

1 year ago

Solved

Relative pose in 2D: problem 2

We consider a world reference frame denoted by {0} which has its x-axis pointing east and its y-axis pointing north. There is a...

1 year ago

Solved

Relative points in 2D: problem 2

The 2D pose of a robot, with respect to a world coordinate frame {O}, is described by a 3x3 homogenous transform matrix T. A la...

1 year ago

Solved

Relative pose in 2D: problem 1

We consider a world reference frame denoted by {0} which has its x-axis pointing east and its y-axis pointing north. There is a...

1 year ago

Solved

USC Fall 2012 ACM : Chemical Analysis

This Challenge is to solve Question D, Chemical Analysis, of the <http://contest.usc.edu/index.php/Fall12/Home USC ACM Fall 2012...

1 year ago

Solved

Repeat Vector Values an Arbitrary Number of Times

Given two vectors of the same size, repeat the values of the first vector the number of times given in a second vector. For exam...

1 year ago

Solved

4 Digit Sequence Repetitions

Given a 4 digit integer, a sequence can be created such that the next digit in the sequence is the ones digit from the sum of th...

1 year ago

Solved

Negative without '-'

Simple: return a negative number without using the '-' sign. Thanks to Problem <https://www.mathworks.com/matlabcentral/cody/...

1 year ago

Solved

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

1 year ago

Solved

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

1 year ago

Solved

Solve equation numerically

y'=y In order to solve equation using computer, numerical analysis are needed. 1st order Euler's method is one of the metho...

1 year ago

Solved

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

1 year ago

Problem

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

1 year ago | 1

Solved

Find the next Fibonacci number

In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

1 year ago