Area of a circle
Given the radius x, y would be the area of a circle.
Pi = 3.1416
3年以上 前
解決済み
Area of a Square
Inside a square is a circle with radius r.
What is the area of the square?
3年以上 前
解決済み
Area of a disk
Find the area of a disk or circle.
x= radius of the disk.
3年以上 前
解決済み
Back to basics 4 - Search Path
Covering some basic topics I haven't seen elsewhere on Cody.
Return a string that is the user's portion of the current search...
Strange Number Algorithms
Three integer numbers will be provided to you. Write a function to
Step1: Multiply first number by 3.
Step2: Add 6 with t...
3年以上 前
解決済み
persistant sum
There will be 9 tests for this problem.
In each test you will be provided with 2 integers n=[n1,n2],
where n2 is equal to t...
3年以上 前
解決済み
Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.
3年以上 前
解決済み
Divide by 4
Given the variable x as your input, divide it by four and put the result in y.
3年以上 前
解決済み
Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...
3年以上 前
解決済み
Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...
Blood test?
Assuming: the genetic makeup (genotype) of a child is coded as a pair with two components, combining half genotype of one parent...
4年弱 前
解決済み
Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0.
a = 3;
b = [1,2,4];
Returns 0.
a = 3;
b = [1,...
4年弱 前
解決済み
Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example:
[q,r] = swap(5,10)
returns q = ...
4年弱 前
解決済み
Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...
4年弱 前
解決済み
Reverse the vector
Reverse the vector elements.
Example:
Input x = [1,2,3,4,5,6,7,8,9]
Output y = [9,8,7,6,5,4,3,2,1]
4年弱 前
解決済み
01 - Scalar variables
Create the following variables:
<<http://samle.dk/STTBDP/Assignment1_1.png>>
4年弱 前
解決済み
An Ohm's Law Calculator
*BACKGROUND / MOTIVATION:*
Many important observations in math and science can be described by short, but powerful, equations...
4年弱 前
解決済み
Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.
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...
4年弱 前
解決済み
Draw 'C'.
Given x as input, generate a x-by-x matrix 'C' using 0 and 1.
example:
x=4
ans=
[0 1 1 1
1 0 0 0
...
4年弱 前
解決済み
Draw 'O' !
Given n as input, generate a n-by-n matrix 'O' using 0 and 1 .
example:
n=4
ans=
[1 1 1 1
1 0 0 1
...