已解决


area of a rectangle
area of a rectangle with base "b" and height "h"

2 years 前

已解决


area of a triangle
area of a triangle, given x as a side

2 years 前

已解决


area of a square
area of a square given x as a side

2 years 前

已解决


Compute the unitary totient of a number
The totient function , the subject of Cody Problems 656 and 50182, gives the number of integers smaller than that are relativel...

2 years 前

已解决


Sum the unitary divisors of a number
Cody Problems 1933 and 46898 deal with , the sum of divisors function. This problem deals with , the sum of unitary divisors fun...

2 years 前

已解决


Count the unitary divisors of a number
Cody Problem 56738 asks for a list of the unitary divisors of a number. For this problem, write a function to count the unitary ...

2 years 前

已解决


List unitary divisors of a number
A unitary divisor of a number divides and satisfies gcd(,) = 1. For example, 9 is a unitary divisor of 18 because gcd(9,2) = ...

2 years 前

已解决


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

2 years 前

已解决


Determine if a given input is even or odd?
Given an input, determine if even or odd.

2 years 前

已解决


Set some matrix elements to zero
First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

2 years 前

已解决


Permute diagonal and antidiagonal
Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

2 years 前

已解决


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

2 years 前

已解决


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

2 years 前

已解决


Rotate input square matrix 90 degrees CCW without rot90
Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

2 years 前

已解决


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

2 years 前

已解决


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

2 years 前

已解决


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

2 years 前

已解决


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

2 years 前

已解决


Mechanical Advantage of a Gear Train
Calculate the mechanical advantage of a gear train. The mechanical advantage of a gear couple is given by MA = T_o/T_i where ...

2 years 前

已解决


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

2 years 前

已解决


Current through resistor
Three resistors (R2, R3, R4) are connected in parallel as shown in the figure. If this combination is connected in series with ...

2 years 前

已解决


Three...is a magic number.
Yes it is... It's a magic number... To help you get rid of that earworm, here's a new Cody problem. You are given a squar...

2 years 前

已解决


Finding neighbors of [-1:1] in a matrix....
Hello All! Well I found this one fun to figure out, all you have to do is make a matrix of 1's or 0's (true or false) that sh...

2 years 前

已解决


Time Expansion
How can you slow down any discrete-time signal? Example Input original signal x. x = [1 2 3 -1 -2 -5 -4] We want t...

2 years 前

已解决


Tridiagonal
Return an n-by-n matrix that has a, b, c as the subdiagonal, main diagonal, and superdiagonal entries in the matrix. Example ...

2 years 前

已解决


Largest territory
Determine whose territory is largest. If there are multiple numbers tied for the largest territory, return the smallest number. ...

2 years 前

已解决


Another colon problem
This is simple problem based on problems 555, 801, 1118, etc. Create an index vector from two input vectors. Example: ...

2 years 前

已解决


counting groups!
This problem is about counting groups. Example If you have x: x = [0.8 0.8 0.8 0.3 0.3 0.4 0.5 0.6 0.6 0.9] then a...

2 years 前

已解决


compress sequence into intervals
You're given a row vector of monotonically increasing integers most of which are consecutive. Find the upper and lower bounds of...

2 years 前

已解决


Unique: Faster 'rows' for large array of uint8
Challenge: Execute unique(a,'rows') Faster for 'a' being uint8. The "unique" function for the 'rows' options may be performe...

2 years 前

加载更多