Resuelto


Can we make a triangle?
Given three positive number, check whether a triangle can be made with these sides length or not. remember that in a triangle su...

11 meses hace

Resuelto


Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

11 meses hace

Resuelto


03 - Matrix Variables 1
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3a.png>> A 9x9 matrix full of 2's (Hint: use *ones* o...

11 meses hace

Resuelto


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

11 meses hace

Resuelto


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

11 meses hace

Resuelto


Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

11 meses hace

Resuelto


Add two numbers
Given a and b, return the sum a+b in c.

11 meses hace

Resuelto


Magic!
Check whether the input matrix is a normal magic square: http://en.wikipedia.org/wiki/Magic_square Output the logical value tr...

11 meses hace

Resuelto


Will there be a new leader?
Simply answer the title.

11 meses hace

Resuelto


Is my wife right?
Regardless of input, output the string 'yes'.

11 meses hace

Resuelto


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The values of B are in the same order a...

11 meses hace

Resuelto


Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

11 meses hace

Resuelto


middleAsColumn: Return all but first and last element as a column vector
Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

11 meses hace

Resuelto


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,2,3]; Returns 1.

11 meses hace

Resuelto


Sum of elements in a vector (★)
(copy of Prob. 3) Find the sum of all the numbers of the input vector x. Input x = [1 2 3 5] Output y is 11 <> ...

11 meses hace

Resuelto


'X'avier
Given a square matrix A of size n, write a function to create a new matrix B where only the elements on the main diagonal and th...

11 meses hace

Resuelto


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

11 meses hace

Resuelto


Pizza!
Given a circular pizza with radius z and thickness a, return the pizza's volume. [ z is first input argument.] Non-scored bonus...

11 meses hace

Resuelto


Last Duplicate
Given an array of integers, find the last duplicate element — that is, the element whose second occurrence appears latest in the...

11 meses hace

Resuelto


Swap between first and last column
The idea is to swap between first and last column Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 ...

11 meses hace

Resuelto


Swap between rows
The idea is to swap between second and second last row Ex = [1 2 3 4 5; 5 4 3 2 1; 1 2 3 4 5; 1 2 3 4 5; ...

11 meses hace

Resuelto


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

11 meses hace

Resuelto


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

11 meses hace

Resuelto


Sum of series
a(n) = n^2 - (n-1)^2 find the summation of the series upto n i.e. a(1)+a(2)+...+a(n)

11 meses hace

Resuelto


Sum of series VI
What is the sum of the following sequence: Σk⋅k! for k=1...n for different n?

11 meses hace

Resuelto


Sum of series V
What is the sum of the following sequence: Σk(k+1) for k=1...n for different n?

11 meses hace

Resuelto


Sum of series IV
What is the sum of the following sequence: Σ(-1)^(k+1) (2k-1)^2 for k=1...n for different n?

11 meses hace

Resuelto


Sum of series III
What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

11 meses hace

Resuelto


Sum of series II
What is the sum of the following sequence: Σ(2k-1)^2 for k=1...n for different n?

11 meses hace

Resuelto


Sum of series I
What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

11 meses hace

Cargar más