Solved

NCHOOSEK - Time Optimization

*Input* * *V* —— Set of all choices, a vector of N, 1 < N < 100 * *K* —— Number of selected choices, a scalar, 0 <= K <=...

24 days ago

Solved

Combinations without using nchoosek

You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...

24 days ago

Solved

Create Combination

Motivation: In many problems, we need to create combinations with the function nchoosek. In some cases, however, choices are lim...

26 days ago

Solved

Repopulate the City

For any population p of positive integers between pmin and pmax, we can calculate histogram count n for a list of evenly dividin...

26 days ago

Solved

Next lexicographic - permutation

Find next lexicographic - permutation (permutations as it would occur in a dictionary order). E.g: nextP('ABCD') = ABDC I...

26 days ago

Solved

Put m balls into n boxes

Can you find all the cases where, if I put 3 balls into 2 boxes the case is 1 1 1 1 1 2 1...

28 days ago

Solved

rectangle in circle

In the figure below, the rectangle at the corner measures a cm x b cm. What is the radius of the circle in cm? <<http://www....

1 month ago

Answered

Is it possible to convert a cell array into individual variables on workspace?

Dynamically creating variables in Matlab is not encouraged. See Stephen Cobeldick's tutorial entry. A better idea is to create ...

Is it possible to convert a cell array into individual variables on workspace?

Dynamically creating variables in Matlab is not encouraged. See Stephen Cobeldick's tutorial entry. A better idea is to create ...

1 month ago | 0

Solved

distance to a straight line (2D) given any 2 distinct points on this straight line

Given 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answ...

1 month ago

Solved

Do the line-segments intersect?

You are given two line segments. Do they cross? Consider one segment as (x1,y1) to (x2,y2), the other segment as (x3,y3) to (...

1 month ago

Solved

Esoteric Trigonometry

From Wikipedia: "All of the trigonometric functions of an angle θ can be constructed geometrically in terms of a unit circle cen...

1 month ago

Solved

LASER Tracker - Mirror Distance and Angle

Determine the mirror's distance and relative angle to the LASER Tracker given the distances to a reference SMR (Spherical Mounte...

1 month ago

Solved

Right and wrong

Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

1 month 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 month ago

Solved

Smallest distance between a point and a rectangle

Given two points *x* and *y* placed at opposite corners of a rectangle, find the minimal euclidean distance between another poin...

1 month ago

Solved

Are you in or are you out?

Given vertices specified by the vectors xv and yv, and a single point specified by the numbers X and Y, return "true" if the poi...

1 month ago

Solved

Circumscribed circles

Given the lengths of the 3 sides of a triangle, output the radius of the circumscribed circle. Example: [3 4 5] -> 2.5

1 month ago

Solved

Similar Triangles - find the height of the tree

Given the height, h1, of a power pole, shorter than a tree, a given distance, x2 away, please find h2, height of the tree. Pleas...

1 month ago

Solved

Angle between two vectors

You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

1 month ago

Solved

Clock Hand Angle 1

Given a time in HH:MM:SS, find the smallest angle (in degrees) between the hour and minute hand

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

2 months ago

Solved

What is the distance from point P(x,y) to the line Ax + By + C = 0?

Given a point, P(x,y), find the distance from this point to a linear line. INPUTS: x, y, A, B, C OUTPUTS: d, the distance ...

2 months ago

Solved

Is the Point in a Circle?

Check whether a point or multiple points is/are in a circle centered at point (x0, y0) with radius r. Points = [x, y]; c...

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

2 months ago

Answered

How to plot a trinomial graph

fun = @(x) x^3; fplot(fun,[-3,3]) Alternatively: x = linspace(-3,3); plot(x,x.^3); % Note the use of .^, for element by ele...

How to plot a trinomial graph

fun = @(x) x^3; fplot(fun,[-3,3]) Alternatively: x = linspace(-3,3); plot(x,x.^3); % Note the use of .^, for element by ele...

2 months ago | 0

Solved

Volume of a Parallelepiped

Calculate the volume of a Parallelepiped given the vectors for three edges that meet at one vertex. A cube is a special case ...

2 months ago

Solved

Are all the three given point in the same line?

In this problem the input is the coordinate of the three points in a XY plane? P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) how can...

2 months ago

Solved

Television Screen Dimensions

Given a width to height ratio of a TV screen given as _w_ and _h_ as well as the diagonal length of the television _l_, return t...

2 months ago

Solved

Angle between Two Vectors

The dot product relationship, a dot b = | a | | b | cos(theta), can be used to determine the acute angle between vector a and ve...

2 months ago

Solved

Clockwise or Counterclockwise

Given a list of 2-d points defining the vertices of a polygon, determine whether these points are sorted clockwise. The input...

2 months ago