Risolto


Lightning strike distance: Writing a function
Write a function named LightningDistance that outputs "distance" given input "seconds". Seconds is the time from seeing lightnin...

oltre 11 anni fa

Risolto


Pizza value using expression with parentheses
Pizza prices are typically listed by diameter, rather than the more relevant feature of area. Compute a pizza's value (cost per ...

oltre 11 anni fa

Risolto


Hamming Weight - Size Scoring
The Hamming Weight, <http://en.wikipedia.org/wiki/Hamming_weight wiki Hamming Weight>, in its most simple form is the number of ...

oltre 11 anni fa

Problema


Compute Hamming distances between each pair of rows from two input matrices
For two input matrices _u_ ( _n_ x _uCols_ ) and _v_ ( _n_ x _vCols_ ) of numbers in range [0..255] (8-bit), such that each colu...

oltre 11 anni fa | 1 | 15 risolutori

Risolto


Compute Hamming distances between each pair of rows from two input matrices
For two input matrices _u_ ( _n_ x _uCols_ ) and _v_ ( _n_ x _vCols_ ) of numbers in range [0..255] (8-bit), such that each colu...

oltre 11 anni fa

Risolto


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

quasi 12 anni fa

Risolto


Find the largest value in the 3D matrix
Given a 3D matrix, A, find the largest value. E.g. >> A = 1:9; >> A=reshape(A,[3 1 3]); >> islargest(A) ans = 9

quasi 12 anni fa

Risolto


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

quasi 12 anni fa

Risolto


Convert a vector into a number
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

quasi 12 anni fa

Risolto


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

quasi 12 anni fa

Risolto


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

quasi 12 anni fa

Risolto


Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

quasi 12 anni fa

Risolto


Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

quasi 12 anni fa

Risolto


Solve the Sudoku Row
*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

quasi 12 anni fa

Risolto


Create a row array using double colon operator
Create a row array from 9 to 1, using the double colon operator.

quasi 12 anni fa

Risolto


Fahrenheit to Celsius using multiple statements
Given a Fahrenheit value F, convert to a Celsius value C. While the equation is C = 5/9 * (F - 32), as an exercise use two state...

quasi 12 anni fa

Risolto


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

quasi 12 anni fa

Risolto


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

quasi 12 anni fa

Risolto


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

quasi 12 anni fa

Risolto


give nth decimal place of pi
max 15th place after the decimal point is ok for now

quasi 12 anni fa

Risolto


Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

quasi 12 anni fa

Risolto


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

quasi 12 anni fa

Risolto


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

quasi 12 anni fa

Risolto


Back to basics 10 - Max Float
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

quasi 12 anni fa

Risolto


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

quasi 12 anni fa

Risolto


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

quasi 12 anni fa

Problema


Compute hamming distance between two binary vectors represented using lists of 1-byte numbers
Let v and u be vectors of the same size with 8-bit integers (0-255). We want to compute the number of bits where those vectors d...

quasi 12 anni fa | 1 | 41 risolutori

Risolto


Compute hamming distance between two binary vectors represented using lists of 1-byte numbers
Let v and u be vectors of the same size with 8-bit integers (0-255). We want to compute the number of bits where those vectors d...

quasi 12 anni fa

Risolto


Return the first and last character of a string
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

quasi 12 anni fa

Risolto


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

quasi 13 anni fa

Carica altro