解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

約9年 前

解決済み


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

10年以上 前

解決済み


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

11年弱 前

解決済み


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

11年弱 前

解決済み


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

11年弱 前

解決済み


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

11年弱 前

解決済み


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

11年弱 前

解決済み


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

約11年 前

解決済み


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

約11年 前

解決済み


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

約11年 前

解決済み


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

約11年 前

解決済み


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

約11年 前

解決済み


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

約11年 前

解決済み


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

約11年 前

解決済み


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.

約11年 前

さらに読み込む