Solved


Swap between first and last
The idea is to swap between first and last row Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; ...

17 days ago

Solved


Swap between first and last column
The idea is to swap between first and last column Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 ...

17 days ago

Solved


Swap two numbers
Example Input: a = 10 b = 20 Output a = 20 b = 10

17 days ago

Solved


Swap between rows
The idea is to swap between second and second last row Ex = [1 2 3 4 5; 5 4 3 2 1; 1 2 3 4 5; 1 2 3 4 5; ...

17 days ago

Solved


Approximation of Pi (vector inputs)
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

17 days ago

Solved


Cell Counting: How Many Draws?
You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

17 days ago

Solved


Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...

17 days ago

Solved


Chess probability
The difference in the ratings between two players serves as a predictor of the outcome of a match (the <http://en.wikipedia.org/...

17 days ago

Solved


Roll the Dice!
Description Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. Example [x1,x2] = rollDice(...

17 days ago

Solved


Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. Slightly harder than it seems like it should be. Exampl...

17 days ago

Solved


Create a constant offset.
Add a constant offset to an array. Example a = [1 3 5 9] offset = 2 y = [3 5 7 11]

18 days ago

Solved


If-then-else
Complete the function below such that if the value of x is in the range 10 to 14, inclusive, the value 18 is assigned to y. Oth...

18 days ago

Solved


Find the nearest integer
Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

18 days ago

Solved


Resistance in a circuit
Two resistors with values of 6.0 ohms and 12 ohms are connected in parallel. This combination is connected in series with a 4 o...

18 days ago

Solved


Basic Mathematics 4
Team #1 is in first place but only one point higher than Team #2. The sum of their two scores is N. What are each team’s scores...

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

18 days ago

Solved


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

18 days ago

Solved


Coefficient of Kinetic friction
A robot exerts a F1 lb. force horizontally on a W lb. crate across a concrete floor at a constant speed. What is the coefficien...

18 days ago

Solved


Basic Mathematics 3
It was announced during a Robotics Competition kick off that two of the trickiest scoring objects are: soup cans, and beach ball...

18 days ago

Solved


How long do each of the stages of the rocket take to burn?
A space rocket has 3 stages: - stage 1, s1; - stage 2, s2; - stage 3, s3. If s1 burns 3 x as long as s2 which burns ...

18 days ago

Solved


Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

18 days 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'

18 days ago

Solved


Convert a numerical matrix into a cell array of strings
Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

18 days ago

Solved


Linear Motion 7
A robot has a maximum rate of acceleration of a m/s2. If the robot starts from rest and reaches a velocity of v2 m/s. How far ha...

21 days ago

Solved


Linear Motion 6
An experimental vehicle traveling at v1 m/s is brought to a full stop in t seconds. How far does it travel before stopping? Roun...

21 days ago

Solved


Linear Motion 5
A robot moving down an incline for 3 seconds undergoes a uniform acceleration of a ft/s2. If the robot has an initial velocity o...

21 days ago

Solved


Linear Motion 4
A robot accelerates at a rate of A ft/s2. Assuming the robot starts from rest how much time is required to reach an object loca...

21 days ago

Solved


Linear Motion 3
Suppose a robot is moving in a straight line and steadily increases its speed. It moves from v1 ft/s to v1+2 ft/s in the first ...

21 days ago

Solved


Linear Motion 2
During testing in the desert, a remotely operated vehicle travels D kilometers over rough terrain. The testing takes place over...

21 days ago

Solved


Linear Motion 1
An object travels N feet in the first second of travel, N feet again during the second second of travel and N feet again during ...

21 days ago

Load more