Solved


Find the area of a triangle
Given a triangle with a base b and height h, return the triangle area.

8 mois ago

Solved


Area of a circle
Given the radius x, y would be the area of a circle. Pi = 3.1416

8 mois ago

Solved


Replacing a row
For matrix G=[1 2 3; 4 5 6; 7 8 9] Replace the 2nd row with 8s **remember to create matrix G

8 mois ago

Solved


Matlab Basics II - Free Fall
An object freely falling from rest under gravity covers a distance x given by: x = 1/2 gt^2 write a function that calculat...

8 mois ago

Solved


Remove the Zero
Given an array n, remove all zeros

8 mois ago

Solved


Ratio between sum of primer numbers and non-prime numbers
Write a function that calculates the ratio between the sum of the prime numbers lower or equal than x, and the sum of the non-pr...

8 mois ago

Solved


Ratio between sum of primes and sum of factors
Write a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of ...

8 mois ago

Solved


07 - Common functions and indexing 6
Create a variable _m_ as a magic square with the size 6 x 6 Magic squares are defined as square matrices, where the sum of a...

9 mois ago

Solved


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

9 mois ago

Solved


Returning a "greater than" vector
Given a vector, v, return a new vector , vNew, containing only values > n. For example: v=[1 2 3 4 5 6] n=3 vNew =...

9 mois ago

Solved


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

9 mois ago

Solved


Easy problem
This is an easy problem. Just click on submit.

9 mois ago

Solved


Add 3 numbers
In this problem, you have to add three numbers a, b and c. Give output d = add(a,b,c)

9 mois ago

Solved


Test Problem; Create a 5x5 array containing all ones
This is a test for learning the process of creating a Cody problem. The goal of this test problem will be to create an array,...

9 mois ago

Solved


Sum of Two Numbers
Given two integer numbers x and y, calculate their sum and put it in z. Examples: Inputs x = 2, y = 4 Output z is 6 ...

9 mois ago

Solved


matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...

9 mois ago

Solved


y equals x divided by 2
function y = x/2

9 mois ago

Solved


Swap two numbers
Example Input: a = 10 b = 20 Output a = 20 b = 10

9 mois ago

Solved


Sphenic number sequence
<http://oeis.org/A007304 Sphenic numbers> are positive integers that are products of three distinct prime numbers: 30, 42, 66, 7...

9 mois ago

Solved


Determine if input is odd or even
Determine if input is odd or even, sample problem

9 mois ago

Solved


Calculate the square of a number (Super Easy)
The goal is to calculate the square (y) of a number (x). Good way to start MatLab for beginners.

9 mois ago

Problem


Ratio between sum of primes and sum of factors
Write a function that calcualtes the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of ...

9 mois ago | 0

Problem


Ratio between sum of primer numbers and non-prime numbers
Write a function that calculates the ratio between the sum of the prime numbers lower or equal than x, and the sum of the non-pr...

9 mois ago | 0

Solved


Sum of a geometric series
Give the sum of the first 'n' terms of a geometric series, given 'a' as the first term and 'r' as the ratio.

9 mois ago

Problem


Sum of a geometric series
Give the sum of the first 'n' terms of a geometric series, given 'a' as the first term and 'r' as the ratio.

9 mois ago | 0

Problem


Get the value 100
Knowing that 123-45-67+89=100, write a function that gives this result for any order of the digits in the input. Otherwise, the ...

9 mois ago | 0

Problem


Get the mean digit
Write a function that gives the mean digit (round towards nearest integer) of an input and positive number. For example: x ...

9 mois ago | 0

Problem


Check if is a square
Given four coordinates, write a function to check if they form a square on the XY plane.

9 mois ago | 0

Solved


Calculate numerical integration.
x=0:0.01:1 y=@(x)x.^2 Using given two inputs(x and y), conduct numerical integration in x. (hint: trapz)

9 mois ago

Solved


Create a constant offset.
Add a constant offset to an array. Example a = [1 3 5 9] offset = 2 y = [3 5 7 11]

9 mois ago

Load more