Risolto


Calculate the base-10 logarithm of a number
Calculate the logarithm of number x

circa un anno fa

Risolto


Determine if a row vector has NaN
Determine if a row vector x has NaN

circa un anno fa

Risolto


factorial of a number x
Factorial of a number x

circa un anno fa

Risolto


Juros Simples
Faça uma função que calcule o montagem de um investimento com juros simples que receba como argumentos o capital inicial C, a ta...

circa un anno fa

Risolto


Calories in a slice of pizza?
The total calories C in a pizza is printed on its box. You know the angle A (degrees) of the slice you placed on your plate. Ple...

circa un anno fa

Risolto


Energy of a photon
&#9883 &#9762 &#9883 &#9762 &#9883 &#9762 &#9883 Given the frequency F of a photon in giga hertz. Find energy E of this photon...

circa un anno fa

Risolto


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

circa un anno fa

Risolto


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

circa un anno fa

Risolto


Find the index of n in magic(n)
If input n=5, then magic(n) is 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22...

circa un anno fa

Risolto


Max Change in Consecutive Elements
If an array is given as input then find the index of consecutive elements that represent maximum change. Example: Input ...

circa un anno fa

Risolto


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

circa un anno fa

Risolto


expand intervals
You're given a row vector of an even number of monotonically increasing integers. Each pair of consecutive integers is the lower...

circa un anno fa

Risolto


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

circa un anno fa

Risolto


calculate the day of the year from a date string.
'09-Oct-2016' is the 283rd day of the year. So doy = dayoftheyear('09-Oct-2016') should return doy = 283

circa un anno fa

Risolto


Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

circa un anno fa

Risolto


vectorization in N
For a given integer n (n>1), compute the sum f (i) (1 <= i <= n) where f (i) = 1 if n is odd and 2 otherwise.

circa un anno fa

Risolto


Solve the matrix equation AXB + X + C = 0 for X
Let A, B, and C be square matrices of equal size, and let the matrix X be defined by the matrix equation A * X * B + X + ...

circa un anno fa

Risolto


Conditional transpose
You're given two vectors of the same length, x and y, which might be row or a column vectors. Your task is to ensure that y has ...

circa un anno fa

Risolto


Breaking up a chocolate bar
You've got a chocolate bar of size , and you want to break it up into bite-sized () pieces. How many steps are required to do th...

circa un anno fa

Risolto


P(girl likes you | she smiled at you)
Compute the probability Given the input probabilities

circa un anno fa

Risolto


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

circa un anno fa

Risolto


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

circa un anno fa

Risolto


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

circa un anno fa

Risolto


convert?
* Given a string containing a number followed by pounds or kgs, for example: * 'Billy lost 22 pounds in four weeks.' * 'Maria ...

circa un anno 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...

circa un anno fa

Risolto


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

circa un anno fa

Risolto


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

circa un anno fa

Risolto


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x = 123045; x_vec = [1 2 3 0 4 5]; I happened upon a trick ...

circa un anno fa

Risolto


Create a square matrix of multiples
Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row. This also applies...

circa un anno fa

Risolto


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

circa un anno fa

Carica altro