已解决


Square wave average calculation
Given its peak and duty cycle, calculate avg value of square wave

10 years 前

已解决


Sort complex numbers into complex conjugate pairs
Sort complex numbers into complex conjugate pairs. Example: Input x = [3-6i -1-4i -1+4i 3+6i] Sorted output = [-1 - ...

10 years 前

已解决


Area of a disk
Find the area of a disk or circle. x= radius of the disk.

10 years 前

已解决


Remove the middle element from a vector
Remove the middle element of a vector? *Example:* [1,2,3] should return 2 [1,2,3,4] should return 2 [] should return...

10 years 前

已解决


Diagonal & Anti-Diagonal Matrix: Easy
Create a matrix as shown below from "magic" square. For example: if input x=9;then use mgic(x) and create the matrix...

10 years 前

已解决


Calculate the peak value of square wave
Given the peak value of sine wave, calculate corresponding peak value of square wave, if both have same RMS voltage.

10 years 前

已解决


Vector Linear sum: (p1-m1)V1+(p2-m2)V2+...(pK-mk)Vk
Calculate the sum of a Vector times coefficients expressed as two strings. Example: Normal representation [ a b c ], [ p1 ...

10 years 前

已解决


Find the square of the sum of the digits of a number
If a number (n) is provided as an input, find the square of the sum of the digits of the number. Example If n = 21, the an...

10 years 前

已解决


Remove entire row and column in the matrix containing the input values
Remove the entire row and column from the matrix containing specific values. The specified value can be a scalar or a vector. Fo...

10 years 前

已解决


Perl 2: pop
_This is part of a series of perl function which were very helpful for many perl programmers. Could you implement it in Matlab?_...

10 years 前

已解决


Perl 3: shift
_This is part of a series of perl function which were very helpful for many perl programmers. Could you implement it in Matlab?_...

10 years 前

已解决


Perl 4: unshift
_This is part of a series of perl function which were very helpful for many perl programmers. Could you implement it in Matlab?_...

10 years 前

已解决


Uniform binary crossover
Given two binary vectors, return the two children by combining the genes of them using a binary crossover mask. More informat...

10 years 前

已解决


Perl 1: push
_This is part of a series of perl function which were very helpful for many perl programmers. Could you implement it in Matlab?_...

10 years 前

已解决


Sunday bonus
Submit a solution on any Sunday and you will get 10 points. Only for MATLAB fans!

10 years 前

已解决


Adding Cells with numbers defined as strings
Given a cell, with strings representing numbers, add each value. For example: a = {'9','33'}; the output should be: ...

10 years 前

已解决


Infernal Recursion
Consider the recursion relation: x_n = (x_(n-1)*x_(n-2))^k Given x_1, x_2, and k, x_n can be found by this definition. Wr...

10 years 前

已解决


Calculate the Hamming distance between two strings
Inspired by a similar Cody problem found <http://www.mathworks.com/matlabcentral/cody/problems/93-calculate-the-levenshtein-dist...

10 years 前

已解决


Is the paranthesis sequence balanced ?
Quantum mechanics and computer science are interested in <http://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation bra-kets>. Today...

10 years 前

已解决


Elapsed time is -0.005204 seconds.
Write a function that takes less than zero seconds to execute, as measured using tic and toc. For repeatability, the test case p...

10 years 前

已解决


Volume difference between Ellipsoid and Sphere
Given an ellipsoid of semi principal axis (a,b,c) find the volume of the difference between this ellipsoid and the sphere with...

10 years 前

已解决


Find the area of the four walls
If length, breadth and height of the walls are given, find the area of the four walls.

10 years 前

已解决


Box!
Given a box, find the volume of the cube. With each side = a.

10 years 前

已解决


Cody Computer Part 4 : Are you a morning Cody player Addicted ?
This is a stupid Cody challenge. You just have to *click "Submit" between 7 and 9 AM.* ... Greenwich Mean Time (GMT). To see ...

10 years 前

已解决


Volume of a sphere given its surface area
You just measured its surface area, that is the input.

10 years 前

已解决


Steal, Share, or Catch
You, I, and a few other characters are going to play a game of *Steal, Share or Catch*. We are going to play it 10,000 times vs...

10 years 前

已解决


Pluralization
Define function plu(n) that returns '' (an empty string) if n=1, or 's' otherwise. This is handy for displaying messages from a...

10 years 前

已解决


Assign matrix rows/columns to separate variables
This is a slight variant of <http://www.mathworks.com/matlabcentral/cody/problems/2668-assign-matrix-elements-to-separate-variab...

10 years 前

已解决


Shorten pathname
Given a pathname string, return a condensed version by replacing intermediate folders with '..'. *Example* If fullpat...

10 years 前

已解决


Calculate the nth Fibonacci number USING 'Golden Ratio' concept
f = [1 1 2 3 5 8 13 ...] If n=6, f(6)=8

10 years 前

加载更多