First N Perfect Squares
*Description*
Return the first N perfect squares
*Example*
input = 4;
output = [ 1 4 9 16 ];
3ヶ月 前
解決済み
Champernowne Constant
The <http://en.wikipedia.org/wiki/Champernowne_constant Champernowne constant> is a real number whose digits in decimal represen...
3ヶ月 前
解決済み
Popular Word Game™ Distance
Professor Ned, who holds the Nedowed Chair of Crackpot Mathematics at the University of Nedsburg, has recently discovered the da...
3ヶ月 前
解決済み
Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for:
A = [ 1 5 8 ]
then
B = [ 1 1 5 ...
3ヶ月 前
解決済み
Find max
Find the maximum value of a given vector or matrix.
Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column:
in:
...
3ヶ月 前
解決済み
Convert a Cell Array into an Array
Given a square cell array:
x = {'01', '56'; '234', '789'};
return a single character array:
y = '0123456789'
3ヶ月 前
解決済み
Linear Motion 7
A robot has a maximum rate of acceleration of a m/s2. If the robot starts from rest and reaches a velocity of v2 m/s. How far ha...
3ヶ月 前
解決済み
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
3ヶ月 前
解決済み
Create a vector
Create a vector from 0 to n by intervals of 2.
3ヶ月 前
解決済み
Flip the vector from right to left
Flip the vector from right to left.
Examples
x=[1:5], then y=[5 4 3 2 1]
x=[1 4 6], then y=[6 4 1];
Request not to use d...
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
3ヶ月 前
解決済み
Transition Matrix for the Royal Game of Err
Bored of tedious court assemblies, King Neduchadneddar the Procrastinator has found a cunning way to keep his advisors, councilo...
Word Counting and Indexing
You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...
3ヶ月 前
解決済み
Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers.
Examples:
[index1 index2] = nearestNumbers([2 5 3...
3ヶ月 前
解決済み
Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...
3ヶ月 前
解決済み
De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if
a =...