Solved


Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

10 hours ago

Solved


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

10 hours ago

Solved


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

10 hours ago

Solved


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

10 hours ago

Solved


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

10 hours ago

Solved


Find the Best Hotels
Given three input variables: hotels - a list of hotel names ratings - their ratings in a city cutoff - the rating at which yo...

10 hours ago

Solved


Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...

10 hours ago

Solved


Calculate BMI
Given a matrix hw (height and weight) with two columns, calculate BMI using these formulas: 1 kilogram = 2.2 pounds 1 inch = 2...

10 hours ago

Solved


Matrix Construction I
Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

10 hours ago

Solved


Toeplitz Matrix
For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

10 hours ago

Solved


Find the next state of a JK Flip-Flop
Find the next state (NS) of a JK Flip-Flop based on previous state (PS), inputs. Learn more about JK Flip-Flop theory here: ...

10 hours ago

Solved


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

11 hours ago

Solved


Is this matrix orthogonal?
Given a square matrix, a, determine whether it is orthogonal. INPUT: a, a n x n matrix OUTPUT: true or false

11 hours ago

Solved


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

11 hours ago

Solved


Approximate e
Given a and n, compute and approximation to f = a * e ^ n, without the use of exp, string operations, or floating point numbers....

11 hours ago

Solved


Polar Form Complex Number Entry
Write a function that takes the magnitude and angle(in degrees) of a complex number and returns a complex variable. Positive ang...

11 hours ago

Solved


Find Logic 30

11 hours ago

Solved


Find Logic 32

11 hours ago

Solved


Find Logic 28

11 hours ago

Solved


Stress-Strain Properties - 8
Up to this point, you've calculated some material properties based on tensile stress-strain data. For this problem, you are task...

11 hours ago

Solved


Stress-Strain Properties - 7
The toughness of a material is technically defined as the plastic strain energy absorbed by the material (the plastic region in ...

11 hours ago

Solved


Stress-Strain Properties - 6
The total energy absorbed by a material up to failure in a tensile test is termed the absorbed strain energy. With respect to th...

11 hours ago

Solved


Matrix to vector transformation
given a matrix, make in the output 1 column vector putting odd numbers in ascending order after that put the even numbers in des...

1 day ago

Solved


Create a vector of the first n natural numbers (★)
If n = 7, your program should return a vector y, where y = [1 2 3 4 5 6 7].

1 day ago

Solved


Check if equal
Return true if all the elements of an nD array are equal, false otherwise.

1 day ago

Solved


Ring Matrix
Given n (only odd), return output matrix a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. ...

1 day ago

Solved


Create logarithmically spaced values (★)
Given three numbers a,b,n with b>a, create a vector y with n logarithmic spaced values between 10^a and 10^b. Thus, if a = -2, ...

1 day ago

Solved


Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

1 day ago

Solved


Remove the air bubbles from a vector
_*A reduced version of Problem 112*_ Given a column vector v, return a vector w in which all the zeros have "bubbled" to the ...

1 day ago

Solved


Guess
A random number between 1 and 10 is created for the variable y. Guess what its value is.

1 day ago

Load more