Solved

Make an anonymous function that has variable output

Make a anonymous function that has variable output. f = @(x)... the following equation→equation(s) as followed has(ve) ...

1 year ago

Solved

Draw 'O' !

Given n as input, generate a n-by-n matrix 'O' using 0 and 1 . example: n=4 ans= [1 1 1 1 1 0 0 1 ...

1 year ago

Solved

Set some matrix elements to zero

First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

1 year ago

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

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

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

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

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

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

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

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

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

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

1 year ago

Solved

how many of the entries are positive?

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

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

1 year 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]

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

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

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

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

1 year 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'...

1 year 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/...

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

1 year ago

Solved

Dealfun (1.0)

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

1 year 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

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

1 year 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)

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

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

1 year 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; ...

1 year ago