Solved


Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

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

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

5 years 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

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

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

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

5 years ago

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

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

5 years ago

Solved


Calculate the area of a triangle between three points
Calculate the area of a triangle between three points: P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) these three points are the vert...

5 years ago

Solved


Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
Find the remaining side of a triangle given the hypotenuse and a side. However, the normal functions and symbols are not allowe...

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

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

5 years ago

Solved


ASCII Birthday Cake
Given an age and a name, give draw an ASCII birthday cake. For example, given the name "CODY" and the age 5, return a string wit...

5 years ago

Solved


Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

5 years ago

Solved


Extra safe primes
Did you know that the number 5 is the first safe prime? A safe prime is a prime number that can be expressed as 2p+1, where p is...

5 years ago

Answered
matrix manipulation - replacing partial matrix subsets in main matrix ???
You can use colon indexing: % Create the two matrices in your example A = ones(3, 5); B = 2 * ones(2, 2); % Use indexing t...

5 years ago | 1

| accepted

Answered
Reduce trailing zeros of text file
Here's how you use fprintf to export two integer columns followed by three floating point columns: % Create array with 5 column...

5 years ago | 1

| accepted

Answered
Execute command if timer runs out
A timer object might work: % Define callback callback = @(x,y)disp('hello world'); % Create timer; this will execute TimerF...

5 years ago | 0

| accepted

Answered
how to set graph size
I'd use daspect to change the aspect ratio of your axes: % Create plot vectors x = [0, 1, 2]; y = [1, 0, 0]; % Plot plot(...

5 years ago | 0

| accepted

Answered
Tracing boundary in RGB image
You just want the outlines of the colored regions stored in another image, right? You can use the gradient function: % Convert...

5 years ago | 0

Answered
Pass GUI information to another GUI depending on a condition
I don't usually use GUIDE, so forgive me if I explain something that GUIDE takes care of automatically. You'll probably want th...

5 years ago | 0

| accepted

Answered
Geometry question for a pong game
One obvious problem (might be a typo), when you assign _theta_ you use _atan2d_, which returns an angle in degrees, and _atan_, ...

7 years ago | 0

Answered
How to display info with mouse over text region inside a figure
Actually, it's not hard at all. MATLAB's pointer manager lets you assign functions to be called whenever the mouse pointer enter...

7 years ago | 3

Solved


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

7 years ago

Solved


Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

7 years ago

Solved


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

7 years ago

Solved


Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

7 years ago

Solved


Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

7 years ago

Load more