已解决


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x = 123045; x_vec = [1 2 3 0 4 5]; I happened upon a trick ...

2 years 前

已解决


Sum of first n positive integers
Given n, find the sum of first n positive integers Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these terms is 55

2 years 前

已解决


Area of a circle
Given the radius x, y would be the area of a circle. Pi = 3.1416

2 years 前

已解决


Square the input
Given a scalar or vector x, return the square of each element. Example x = [7 2] answer = [49 4]

2 years 前

已解决


nth Rational Number
Return the nth rational number. This is the inverse to Problem <http://www.mathworks.com/matlabcentral/cody/problems/1471 1...

2 years 前

已解决


Index of a Rational number
The set of real numbers are infinite. They are so many that real numbers can't even be enumerated. However, unlike real numbers ...

2 years 前

已解决


Generate a Parasitic Number
This problem is the next step up from <http://www.mathworks.com/matlabcentral/cody/problems/156-parasitic-numbers Problem 156>. ...

2 years 前

已解决


Matlab Basics II - Operations and Matrix Dimensions
Write a function that takes two inputs, a & b, and outputs the sum and product of the two matrices. The matrices have OPPOSITE d...

2 years 前

已解决


Wrapping the Tower of Pisa
The famous artist Christo Vladimirov Javacheff, who likes pizza, wants to wrap the well-known Italian tower in paper. It is a ci...

2 years 前

已解决


Implement simple rotation cypher
If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

2 years 前

已解决


Flag largest magnitude swings as they occur
You have a phenomenon that produces strictly positive or negative results. delta = [1 -3 4 2 -1 6 -2 -7]; Marching through thi...

2 years 前

已解决


How many trades represent all the profit?
Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

2 years 前

已解决


Tiling a matrix
Given a matrix and a number of columns, replicate matrix in a single row

2 years 前

已解决


Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A; Output: A=(Aij),where each entry Aij is either...

2 years 前

已解决


Who invented zero?
We know the importance zero in computer science, mathematics... but who invented zero? Clue: He was the first in the line ...

2 years 前

已解决


Circumscribed circles
Given the lengths of the 3 sides of a triangle, output the radius of the circumscribed circle. Example: [3 4 5] -> 2.5

2 years 前

已解决


Determine if a Given Number is a Triangle Number
*Description:* Determine if the elements of an input array are triangle numbers and return the result as an array with the sa...

2 years 前

已解决


Polite numbers. N-th polite number.
A polite number is an integer that sums of at least two consecutive positive integers. For example _7 = 3+4_ so 7 is a polite...

2 years 前

已解决


calculate RMS voltage
given peak to peak voltage, calculate rms voltage

2 years 前

已解决


Matlab Basics - Convert a row vector to a column vector
Write a script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any...

2 years 前

已解决


Roots
Find out the roots of a given polynomial equation.Given are the coefficients of the equation.

2 years 前

已解决


Matlab Basics II - Velocity of a particle
A particle is moving in space, such that it's velocity is given by: <<http://s30.postimg.org/5rf1xtvj5/cody1.png>> write a...

2 years 前

已解决


Matlab Basics II - Extract last 3 elements of a vector
Let x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives t...

2 years 前

已解决


Matlab Basics II - Max & Index of Max
Write a function that takes a vector x, then returns both the max value in x and its location in the vector for example x ...

2 years 前

已解决


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

2 years 前

已解决


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

2 years 前

已解决


Convert from integer to binary
if true % decimalToBinaryVector(x) end

2 years 前

已解决


Change string to number
Change given string to number. (hint: there is already function) Changing from ['1234'] to [1234] is one of example

2 years 前

已解决


sum all digits
input = 123456789, output = 1+2+3+4+5+6+7+8+9 = 45

2 years 前

已解决


Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

2 years 前

加载更多