A résolu


Vector of digits (★★)
Given a positive integer x, construct a vector y with all the digits of x in the order of appearance in x. Thus, if x = 172...

4 jours il y a

A résolu


Generate n equally spaced "intervals" between -x and x (★)
Given n and x, return a list of numbers (in ascending order) that divides the interval [-x x] into n equal-length intervals. ...

4 jours il y a

A résolu


Create a vector of n alternating ones and zeros (★★)
Given n, your output should be a vector y of numbers such that the first number is 1 and the numbers following it alternate betw...

4 jours il y a

A résolu


Corresponding ASCII code.
Given the number, the output will show the corresponding ASCII code.

4 jours il y a

A résolu


Vector with a repeated entry
Create a row vector of length n, filled with 4's. For example, if n = 3, output = [4 4 4]

4 jours il y a

A résolu


Sum of terms in a series 1 (★★★)
Given x and n, compute the following sum: |x|+|x|^(1/2)+|x|^(1/3)+|x|^(1/4)+|x|^(1/5) ... + |x|^(1/n) where ||x|| indica...

4 jours il y a

A résolu


Magnitude of a vector (★★★)
Given a vector x with values [ x1, x2, x3, ..., xn ], compute the magnitude (or length) of the vector which is given by href ...

4 jours il y a

A résolu


Create a vector of the first n odd numbers (★)
If n = 10, your program should return a vector y, where y = [1 3 5 7 9 11 13 15 17 19].

4 jours il y a

A résolu


Vector raised to a power, element-wise (★)
Given a vector A and a number x, raise each element of the vector to the power of x. Thus, if A = [2 5 7 1] and x = 0.5, then ...

4 jours il y a

A résolu


Function 1 (★)
Compute the value of <<https://i.imgur.com/AxKWLmE.gif>> for any given positive x.

4 jours il y a

A résolu


Convert matrix to 3D array of triangular matrices
Given a 2D numeric array x in which each column represents the vectorized form of an upper triangular matrix, return a 3D array ...

4 jours il y a

A résolu


Must be in the front row...
You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...

4 jours il y a

A résolu


Magnet and Iron
(Inspired from <http://www.mathworks.com/matlabcentral/cody/problems/112 Problem 112: Remove the air bubbles>) Iron (atomic n...

4 jours il y a

A résolu


Swap the first and last columns (★★)
(copy of Prob 19) Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becom...

8 jours il y a

A résolu


Easy Sequences 39: Perfect Squares in Pascal's Triangle
Consider the 2nd, 3rd and 4th diagonals of the Pascal's Triangle, shown highlighted below: ...

16 jours il y a

A résolu


Number of paths on a 3d grid
This problem is inspired by <https://www.mathworks.com/matlabcentral/cody/problems/1483-number-of-paths-on-a-grid>, which you mi...

16 jours il y a

A résolu


Number of paths on a grid
Consider a grid formed by n vertices vertically down, and m vertices horizontally right. Your starting point is at the top lef...

16 jours il y a

A résolu


Newton’s First Law – Net Force in Equilibrium
At a manufacturing plant operated by Reliance Industries in Jamnagar, a heavy equipment box rests on the factory floor. Even th...

17 jours il y a

A résolu


Newton’s Second Law – Gravitational Force on a Falling Object
During a relief mission organized by the Indian Air Force, supply packages are dropped from aircraft to remote flood-affected ar...

17 jours il y a

A résolu


Newton’s Second Law – Acceleration of Connected Objects
Engineers at Boston Dynamics are testing two robots connected by a rope on a frictionless surface. Robot A pulls Robot B using ...

17 jours il y a

A résolu


Newton’s Second Law – Force Produced by a Car Engine
Automotive engineers at Tata Motors are testing a new electric car prototype on a straight test track in Pune. The engineers wa...

17 jours il y a

A résolu


Newton’s Third Law – Action and Reaction in Rocket Launch
Scientists at SpaceX are testing a rocket engine before launch from their facility. When the rocket pushes exhaust gases downwa...

17 jours il y a

A résolu


Newton’s Second Law – Normal Force in an Accelerating Elevator
Engineers at Otis Elevator Company are testing a new high-speed elevator installed in the Burj Khalifa. When the elevator accel...

17 jours il y a

A résolu


Newton’s Second Law – Motion on an Inclined Plane
In the mountainous region near Manali, a rescue team is testing a motorized emergency vehicle designed to climb steep slopes. E...

17 jours il y a

A résolu


Newton’s First Law – Force Needed to Start Motion
At Indira Gandhi International Airport, a heavy suitcase is sitting on a stationary conveyor belt. The belt is initially at rest...

17 jours il y a

A résolu


Newton’s Second Law – Acceleration of a Mars Rover
At NASA's robotics laboratory, engineers are preparing a prototype rover for a future mission to Mars. Before sending the rover...

17 jours il y a

A résolu


Newton’s Second Law – Force Required to Accelerate a Rocket Cart
At ISRO's training center, engineering students are testing a small rocket-powered cart on a straight frictionless track. The ca...

17 jours il y a

A résolu


Given a Polyshape_01 (ps) Return its Perimeter, Area, and Centroid.
Return the perimeter (P) of a polyshape object, which is the sum of the lengths of its boundaries. Return the total area (A) of...

17 jours il y a

A résolu


5-year Annedversaries
This is the Bonus Round problem for the 2025 Cody Contest. Attend the watch party on Friday, March 27 to see how 6 champions fro...

18 jours il y a

A résolu


Angular Velocity of a Falling Rod Pivoted at One End (Energy + Rotation)
Engineers at Indian Institute of Technology Bombay are designing a rotating docking arm for a future space station. The arm is m...

26 jours il y a

Charger plus