Solved


Problem for beginners
M is a nxm matrix. Swap the fist and the second last column with eachother. X=[1 2 3;4 5 6;7 8 9] Y=[2 1 3;5 4 6;8 7 9]

6 years ago

Solved


Stairs
Make an n by n matrix, where the elements are ones and zeros. In the main diagonal, and under that, there should be only ones (...

6 years ago

Solved


Square
X is a number, write a code, where Y should be the square of X.

6 years ago

Solved


Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.

6 years ago

Solved


Matrix problem for beginners
Make a matrix [0,0,0;1,1,1;2,2,2]. X=[0,1,2]

6 years ago

Solved


Matrix for beginners
Multiply x and y elemwise.

6 years ago

Solved


find the surface area of a cube
given cube side length x, find the surface area of the cube, set it equal to y

6 years ago

Solved


Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

6 years ago

Solved


Square a Number
Given an input x, return y, which is equal to the square of x.

6 years ago

Solved


Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...

6 years ago

Solved


Convert radians to degrees
Given input in radians, output to degrees

6 years ago

Solved


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

6 years ago

Solved


Given a square and a circle, please decide whether the square covers more area.
You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

6 years ago

Solved


Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

6 years ago

Solved


radius of a spherical planet
You just measured its surface area, that is the input.

6 years ago

Solved


Pi Estimate 1
Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

6 years ago

Solved


Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

6 years ago

Solved


Delete blanks at the end of string
you got to delete all blank spaces which appears at the end of string

6 years ago

Solved


multiply by three
Given the variable x as your input, multiply it by 3 and put the result equal to y. Examples: Input x = 2 Output y is ...

6 years ago

Solved


Output a vector which is table of 9
Output a vector which is table of 9

6 years ago

Solved


Is it prime?
Given a number, check whether it is prime or not. If prime output is true, otherwise false.

6 years ago

Solved


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

6 years ago

Solved


Determine the square root
Determine the square root of the value the user has entered, n.

6 years ago

Solved


Log of a number
Write a script that will give the log of x as output.

6 years ago

Solved


Calculate the logarithm of number
Calculate the logarithm of number x

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

6 years ago

Solved


Matlab Basics - y as a function of x
Write a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2

6 years ago

Solved


Do you like your boss?
Do you like your boss? Answer can be any string! For example: Boss = 'Do you like your boss?'; Output = 'yes' or ...

6 years ago

Solved


Mode
Find the mode of the vector Assumption: no vector is bimodal Example 1: input=[1 2 3 4 4]; output=4 Example 2: input=[7...

6 years ago

Solved


Find out value of sine given by degree.
Find out value of sine given by degree. If theta=30, it's value must be 0.5.

6 years ago

Load more