Solved


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

ungefär 9 år ago

Solved


Solve the Sudoku Row
*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

ungefär 9 år ago

Solved


Multielement indexing of a row array
The row array birthRateChina stores the China birth rate (per 1000 people) for years 2000 to 2012. Write a statement that create...

ungefär 9 år ago

Solved


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

ungefär 9 år ago

Solved


Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

ungefär 9 år ago

Solved


Lightning strike distance: Writing a function
Write a function named LightningDistance that outputs "distance" given input "seconds". Seconds is the time from seeing lightnin...

ungefär 9 år ago

Solved


Pizza value using expression with parentheses
Pizza prices are typically listed by diameter, rather than the more relevant feature of area. Compute a pizza's value (cost per ...

ungefär 9 år ago

Solved


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

ungefär 9 år ago

Solved


Replace every 3rd element in a vector with 4
x is a vector of undetermined length You are to replace every 3rd element with the number 4, example: x = [11 23 34 43 2 3...

ungefär 9 år ago

Solved


Finding an element in a vector
x is a vector of unknown length your function should return the index of the first element in the vector that is greater than...

ungefär 9 år ago

Solved


Create a row array using double colon operator
Create a row array from 9 to 1, using the double colon operator.

ungefär 9 år ago

Solved


Fahrenheit to Celsius using multiple statements
Given a Fahrenheit value F, convert to a Celsius value C. While the equation is C = 5/9 * (F - 32), as an exercise use two state...

ungefär 9 år ago

Solved


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

ungefär 9 år ago

Solved


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

ungefär 9 år ago

Solved


Hardy-Ramanujan number
Find the first Hardy-Ramanujan number.

ungefär 9 år ago

Solved


Multiplying Vectors 101
Make a vector from 1 to x then multiply the sum of that vector by 2.

ungefär 9 år ago

Solved


Count ones
Write a program to count number of ones (1s) in an integer variable input. For example: Input x=2200112231 output y=3 I...

mer än 10 år ago

Solved


Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

nästan 11 år ago

Solved


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

nästan 11 år ago

Solved


given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

nästan 11 år ago

Solved


surface of a spherical planet
you just discovered its circumference, that is the input.

nästan 11 år ago

Solved


Return a list sorted by number of occurrences
Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

nästan 11 år ago

Solved


Saving MATLAB session to a file
How to save MATLAB session to a file?

ungefär 11 år ago

Solved


Calculate compression ratio of engine
Calculate compression ratio of engine given compression volume of cylinder(Vc), piston stroke(s) and valve diameter(d)

ungefär 11 år ago

Solved


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

ungefär 11 år ago

Solved


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

ungefär 11 år ago

Solved


Elapsed Time
Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

ungefär 11 år ago

Solved


only input
Return the output without writing any code into the function.

ungefär 11 år ago

Solved


frame of the matrix
Given the matrix M, return M without the external frame.

ungefär 11 år ago

Solved


subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

ungefär 11 år ago

Load more