Solved

Go back n times

You will be given a column vector (such as x = [1; 2; 3; 4; 5; 6]). If (n=3) you will return following; [ 1 NaN NaN NaN ...

environ un an ago

Solved

Covering area

As an extension of the problem <http://www.mathworks.com/matlabcentral/cody/problems/416-polygon-area>, find the area, bounded b...

plus d'un an ago

Solved

Spherical radius given four points

Determine the radius of a sphere provided four non-coplanar points on the surface of the sphere. pts = [x1 y1 z1; x...

plus d'un an ago

Solved

Stop a ZigZag scanning N*N Matrix at any diag you want

Suppose that we have a 2-D matrix and we try to obtain a 1-D array in zig-zag order, but not all values of our 2-D matrix e...

plus d'un an ago

Solved

Great Circle Distance

Find shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphe...

plus d'un an ago

Solved

Right Triangle Side Lengths (Inspired by Project Euler Problem 39)

If _p_ is the perimeter of a right angle triangle with integral length sides, { _a_, _b_, _c_ }, there are exactly three solutio...

plus d'un an ago

Solved

Prime Product

My professor has given a sequence of N numbers as a1, a2, ..., aN and asked me to find the smallest possible value of ai * aj su...

plus d'un an ago

Solved

longest common substring : Skipped character version

Two strings are given. Find the longest common substring between them. The substring characters need not be adjacent. They, howe...

plus d'un an ago

Solved

Alternative Dimensions

Given a multidimensional matrix, transform the matrix so the dimensions are in the order given by variable ord. For example, giv...

plus d'un an ago

Solved

Jack's hand in "Titanic" ♤

Given a series of cards, return true if it's the famous hand. Note that i pretend that poker cards goes from 1 to 10 so be care...

plus d'un an ago

Solved

how many of the entries are positive?

Given x= sin(linspace(0,10*pi,100)), how many of the entries are positive?

plus d'un an ago

Solved

matrix zigzag

Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

plus d'un an ago

Solved

Zigzag of square matrix

find zigzag of square matrix in one dimension array a=[1 2 3;4 5 6;7 8 9]; should return b= [1 2 4 7 5 3 6 8 9]

plus d'un an ago

Solved

GJam 2014 China Rd B: Sudoku Checker

This Challenge is derived from <http://code.google.com/codejam/contest/2929486/dashboard#s=p0 GJam 2014 China Sudoku>. Large Cas...

plus d'un an ago

Solved

Minimum Sum thru a Lower Triangle

This Challenge is to find the minimum cumulative sum that traverses from row-1 thru row-N via vertical/diagonal adjacent element...

plus d'un an ago

Solved

Remove TeX from string

Matlab’s TeX support in figure windows is great for displaying information in a visually appealing way. However, many of the TeX...

plus d'un an ago

Solved

Is the test point on the line segment?

Given the [x,y,z] coordinates for the three points pa, pb, and pc, return true if the test point pc is on the line segment with ...

plus d'un an ago

Solved

Initialize a varible with an integer value from a another variable which is assigned with a character value.

Initialize a varible with an integer value from a another variable which is assigned with a character value. ex: Test = 'c'...

plus d'un an ago

Solved

Backward Substitution

Solve a upper triangular linear set of equations as described in the following link: http://www.people.virginia.edu/~teh1m/cody/...

plus d'un an ago

Solved

Track Logic

A sensor produces either a hit (1) or a miss (0) for a given target once per scan. The sensor is also equiped with a tracker whi...

plus d'un an ago

Solved

Dealfun (1.0)

*Short description.* Write a function _dealfun_: [y1,y2,...,yn]=dealfun(fhandle,x1,x2,...,xn) which evaluates the f...

plus d'un an ago

Solved

Get the variable value from a string and generate sum

Get the variable value from a string. Example. x = 'A=10' y = 'B=20' Result = (x+y) Result = 30

plus d'un an ago

Solved

I want eval

A valid MATLAB statement containing a definition of a vector is passed as a string S. Determine the length of the vector. Inp...

plus d'un an ago

Solved

Find Month & day for given day number of a year

Find Month & day for given day number of a year (day number is any number ranging from 1 to 366)

plus d'un an ago

Solved

Code Wheel

Create a function that offsets each value in a given string by a given amount. For instance, codewheel('hello',1) s...

plus d'un an ago

Solved

UICBioE240 2.7

Given two 3-element vectors x1 and x2, create a 3 x 3 x 3 matrix Y where (:,:,1) has all values of x1 * x2, (:,:,2) has all valu...

plus d'un an ago

Solved

last n digit of a power function

Calculate the power of a given a base, exponent. Return the last n digit number. Example 1: base = 3; expo = 8; n = 3; ...

plus d'un an ago

Solved

Linear Least Squares (L2 fitting problem )

Given a set of real measurements (x(i), y(i)) find a line sol(1)x + sol(2) (more specifically furnish the vector with...

plus d'un an ago

Solved

Full combinations

Given n input vectors x1, x2, …, xn, generate a p*n matrix y whose rows contain all element-wise combinations of the vectors x1,...

plus d'un an ago

Solved

Ring Matrix

Given n (only odd), return output matrix a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. ...

plus d'un an ago