Resuelto


Cancel Middle
Write a function called cancel_middle that takes A, an n-by-m matrix, as an input where both n and m are odd numbers an...

alrededor de 4 años hace

Resuelto


Double Fibonacci
double_fibonacci takes two integers, each greater than one, as input arguments (it does not have to check the format of the inpu...

alrededor de 4 años hace

Resuelto


Nth Order Polynomial Regression
Inputs: -two vectors x and y (row or column) -order of polynomial, p Outputs: -vector of coefficients [b0 b...

alrededor de 4 años hace

Resuelto


Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

alrededor de 4 años hace

Resuelto


Create a function that gives a matrix like the following
x=3 y= [1 -1 -1 0 1 -1 0 0 1]; -------------------------------- x=5 y= [ 1 -1 -...

alrededor de 4 años hace

Resuelto


Sequence
Let S be a sequence of numbers Let Find for some , where and .

alrededor de 4 años hace

Resuelto


Determine whether one vector is a subset of another
While bumbling through a pair of problems in the Number Theory group, I wrote code to determine whether a vector is a subset of ...

alrededor de 4 años hace

Resuelto


Find all prime factors of the input
Given an input x, find its all prime factors. Return the vector with all factors in ascending order. Efficiency is the key here...

alrededor de 4 años hace

Resuelto


Chain multiplication - 01
Say, you are given two matrices - A (shape= 3*4) and B(shape = 4*5). If you multiply these two matrices, the resultant matrix w...

alrededor de 4 años hace

Resuelto


Number of leaps in binary search
Binary search is one of the most popular searching algorithms (Binary Search Algorithm). It works only in a sorted array. It uti...

alrededor de 4 años hace

Resuelto


Cut the rod
A rod of length n can be cut in different sizes. Different price is associated with different length of cuts. length, len= [1,...

alrededor de 4 años hace

Resuelto


Sort Non-zeros
Consider 0s in a vector creates a break-point. sort all the sub-arrays created by those break points. For example, a = [3, 4, 1...

alrededor de 4 años hace

Resuelto


Find the number of primes leq than input
Given an integer n, determine the number of primes less than or equal to n.

alrededor de 4 años hace

Resuelto


Draw 'W'
For any given n, return a matrix of height n and width 4n-3 containing a W of ones. Example: n=2 ans= [1 0 1 0 1 0 1 0 1 0...

alrededor de 4 años hace

Resuelto


String Logic 17
Examples: 'DIG' --> 'GDI' 'IMPORTANT' --> 'TANTIMPOR' 'DEAL' --> 'EALD' 'LIMB' --> 'IMBL' 'MOSTLY' --> 'YMOSTL'

alrededor de 4 años hace

Resuelto


String Logic 16
Examples: 'DIG' --> 'DIG' 'KIMBALL' --> 'ALLKIMB' 'DEAL' --> 'EALD' 'LIMB' --> 'IMBL' 'MADE' --> 'ADEM'

alrededor de 4 años hace

Resuelto


Find Min and Max Differences in a Vector
Given an array of integers, return the absolute largest and smallest (non zero) difference between any two numbers in the array....

alrededor de 4 años hace

Resuelto


Use a timetable to analyze a train timetable (Part 1)
Oh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. Th...

alrededor de 4 años hace

Resuelto


First use of arrayfun() and anonymous function @(x)
Create an anonymous function using @(x) for a parabola equation for the given coefficients stored in s with s(1)x2 + s(2)x + s(...

alrededor de 4 años hace

Resuelto


Absolute Value of the Product of Complex Numbers
Find the absolute value (modulus) of the product of two complex numbers given by a + bi and c + di.

alrededor de 4 años hace

Resuelto


Find the nth composite number.
Everyone heard about the nth prime number. Let's try to find out the nth composite. For example , 1 is the first composite, 10 i...

alrededor de 4 años hace

Resuelto


Draw the symbol '+'
Draw '+' in an x-by-x matrix (where x is odd and x >3) Example: x = 5 y = [0 0 1 0 0 0 0 1 0 0 1 1 1 1 1 0 ...

alrededor de 4 años hace

Resuelto


The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...

alrededor de 4 años hace

Resuelto


Sum of digits of powers of 2
Given n, first, calculate the number 2^n. Then, sum the digits that comprise that number. For example: Input: n = 7 2^n = ...

alrededor de 4 años hace

Resuelto


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

alrededor de 4 años hace

Resuelto


Sum of Arithmetic Progression
Given the starting number, difference and the number of terms - find the sum of the arithmetic progression.

alrededor de 4 años hace

Resuelto


Find the slope of a line that passes through two vectors
Given two vectors p1 and p2, return the slope of a line that passes through p1 and p2. Examples: Input [p1,p2] = deal([0,1],[...

alrededor de 4 años hace

Resuelto


Add the number of horizontal and vertical movements to each matrix element
Given n, create a square matrix and with element (1,1) = 1, add 1 to each element for each horitizonal and vertical movement. E...

alrededor de 4 años hace

Resuelto


Check if a matrix Diagonal is equal to its secondary diagonal
Your function should return True if the secondary diagonal is equal to diagonal, and False otherwise. Eg: M = [1 2 1 ...

alrededor de 4 años hace

Resuelto


String Logic 15
Examples: 'CAT' --> 'XZG' 'DOG' --> 'WLT' 'ROSY' --> 'ILHB' 'MOSTLY' --> 'NLHGOB'

alrededor de 4 años hace

Cargar más