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

casi 4 años hace

Resuelto


Matrix multiplication
Multiply two incoming matrices via matrix multiplication

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

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

casi 4 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]

casi 4 años hace

Resuelto


Volume of Cylinder
Find the volume of a cylinder

casi 4 años hace

Resuelto


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

casi 4 años hace

Resuelto


Factorize uniquely! (★★)

casi 4 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]

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

casi 4 años hace

Resuelto


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

casi 4 años hace

Resuelto


area of a sphere

casi 4 años hace

Resuelto


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

casi 4 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

casi 4 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

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

casi 4 años hace

Resuelto


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

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

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

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

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

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

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

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

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

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

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

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

casi 4 años hace

Resuelto


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

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

casi 4 años hace

Cargar más