A résolu


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

11 mois il y a

A résolu


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

11 mois il y a

A résolu


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

12 mois il y a

A résolu


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.

12 mois il y a

A résolu


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

12 mois il y a

A résolu


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the numbers. Otherwise return false. Example...

12 mois il y a

A résolu


Sum of series VII
What is the sum of the following sequence: Σ(km^k)/(k+m)! for k=1...n for different n and m?

12 mois il y a

A résolu


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

12 mois il y a

A résolu


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

12 mois il y a

A résolu


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?

12 mois il y a

A résolu


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

12 mois il y a

A résolu


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

12 mois il y a

A résolu


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

12 mois il y a

A résolu


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

12 mois il y a

A résolu


radius of a spherical planet
You just measured its surface area, that is the input.

12 mois il y a

A résolu


Given a square and a circle, please decide whether the square covers more area.
You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

12 mois il y a

A résolu


Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

12 mois il y a

A résolu


Convert radians to degrees
Given input in radians, output to degrees

12 mois il y a

A résolu


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

12 mois il y a

A résolu


Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

12 mois il y a

A résolu


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

12 mois il y a

A résolu


Plot Damped Sinusoid
Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

12 mois il y a

A résolu


Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as y = A.ⅇ^(-λt)*cos(2πft) where A, λ, and f are scalars and t is a vector. ...

12 mois il y a

A résolu


Find the Best Hotels
Given three input variables: hotels - a list of hotel names ratings - their ratings in a city cutoff - the rating at which yo...

environ un an il y a

A résolu


Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

environ un an il y a

A résolu


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

environ un an il y a

A résolu


Inner product of two vectors
Find the inner product of two vectors.

environ un an il y a

A résolu


Create a vector
Create a vector from 0 to n by intervals of 2.

environ un an il y a

A résolu


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

environ un an il y a

A résolu


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

environ un an il y a

Charger plus