Resuelto


Vector of digits (★★)
Given a positive integer x, construct a vector y with all the digits of x in the order of appearance in x. Thus, if x = 172...

más de 3 años hace

Resuelto


Matrix multiplication
Multiply two incoming matrices via matrix multiplication

más de 3 años hace

Resuelto


Sum of elements in a vector (★)
(copy of Prob. 3) Find the sum of all the numbers of the input vector x. Input x = [1 2 3 5] Output y is 11 <> ...

más de 3 años hace

Resuelto


Vector raised to a power, element-wise (★)
Given a vector A and a number x, raise each element of the vector to the power of x. Thus, if A = [2 5 7 1] and x = 0.5, then ...

más de 3 años hace

Resuelto


Create a vector with n repeated values of a number x (★★)
If x=3 and n=7 then the vector y would be y=[3 3 3 3 3 3 3]

más de 3 años hace

Resuelto


Volume of Cylinder
Find the volume of a cylinder

más de 3 años hace

Resuelto


Vector Element Multiplication
Take two incoming vectors, and output the element wise multiplication of the vectors.

más de 3 años hace

Resuelto


Factorize uniquely! (★★)

más de 3 años hace

Resuelto


Hard limit function
Classify x data as if x>=0 then y=1 if x<0 then y=0 Example x = [ -2 -1 0 1 2] y = [ 0 0 1 1 1]

más de 3 años hace

Resuelto


Replicate elements in vectors (★★★)
(copy of Prob 867) Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2...

más de 3 años hace

Resuelto


Function 1 (★)
Compute the value of <<https://i.imgur.com/AxKWLmE.gif>> for any given positive x.

más de 3 años hace

Resuelto


area of a sphere

más de 3 años hace

Resuelto


find the roots of a quadratic equation
for e.g x = [ 2 -1 -3] y = [1.5 -1]

más de 3 años hace

Resuelto


Back to basics 5 - Clipboard
Covering some basic topics I haven't seen elsewhere on Cody. Copy the input string to the clipboard

más de 3 años hace

Resuelto


Calculate distance travelled when given radius and rotations
When given radius of wheel and number of rotations calculate total distance travelled consider pi=3.14

más de 3 años hace

Resuelto


Back to basics 19 - character types
Covering some basic topics I haven't seen elsewhere on Cody. Return the number of punctuation characters in the input variabl...

más de 3 años hace

Resuelto


Will there be a new leader?
Simply answer the title.

más de 3 años hace

Resuelto


Flipping
Write code that can reverse the vector without using any sort of loop. Example Given the input vector A = [ 1 2 3 4 5...

más de 3 años hace

Resuelto


Approximate the cosine function
Without using MATLAB trigonometric functions, calculate the cosine of an argument x to a precision of 0.0001 Hint: You may wish...

más de 3 años hace

Resuelto


Pernicious Anniversary Problem
Since Cody is 5 years old, it's pernicious. A <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer w...

más de 3 años hace

Resuelto


Find the largest number
Find the largest number |x| among 4 numbers given as variables |a|, |b|, |c|, and |d|. Example: Input: a = 4; b = 7; c ...

más de 3 años hace

Resuelto


Narcissistic number ?
Inspired by Problem 2056 created by Ted. In recreational number theory, a narcissistic number is a number that is the sum of ...

más de 3 años hace

Resuelto


The 5th Root
Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

más de 3 años hace

Resuelto


How many Integers?
Count the integers in a given vector |v|. You *must* use a loop to count each element separately. Examples: Input: v...

más de 3 años hace

Resuelto


Eye Squared
For a positive integer |n| create the identity matrix with |n| elements. In case it is not possible to produce an identity ma...

más de 3 años hace

Resuelto


Sum of adjacent elements in a vector
Given a vector v, return a vector s containting the sum of every two adjacent elements in the vector. Every element s(i) cont...

más de 3 años hace

Resuelto


Determine if input is a Narcissistic number
<http://en.wikipedia.org/wiki/Narcissistic_number Narcissistic number> is a number that is the sum of its own digits each raised...

más de 3 años hace

Resuelto


Find out sum of prime number till given number
Find out sum of prime number till given number Example, if number is 10, then answer must be 17.

más de 3 años hace

Resuelto


Tiling a matrix
Given a matrix and a number of columns, replicate matrix in a single row

más de 3 años hace

Resuelto


Convert Fahrenheit to Celsius
Calculate the Celsius temperature C given the Fahrenheit temperature F. Examples: Input F = 90 Output C is 32.22 I...

más de 3 años hace

Cargar más