Solved


Procrustean bed
Given a vector x and an integer n, convert x to a vector of length n by (1) chopping off the end if it is too long, or (2) addin...

5 years ago

Solved


Leap years on other planets
A year is a leap year if it is divisible by 4, but not if it is divisible by 100, unless it is also divisible by 400. This mean...

5 years ago

Solved


Pluralization
Define function plu(n) that returns '' (an empty string) if n=1, or 's' otherwise. This is handy for displaying messages from a...

5 years ago

Solved


Mystery problem
Given integer x between 1 and 50, return integer y=mystery(x), where mystery(1) = 111 mystery(6) = 809 ... mystery...

5 years ago

Answered
How to find index range of range of values in an array
i = find(x>=69 & x<=72);;

5 years ago | 1

Solved


Radiation Heat Transfer — View Factors (3)
View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates bet...

5 years ago

Solved


Radiation Heat Transfer — View Factors (2)
View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates bet...

5 years ago

Solved


Radiation Heat Transfer — View Factors (1)
View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates bet...

5 years ago

Solved


Packing oranges - one layer
Help the seller to pack oranges efficiently. How many oranges can be put into a box in one layer without squeezing them? Give...

5 years ago

Solved


Cut an orange
Inspired by problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2175 2175>. A hungry matlab enthusiast has an ora...

5 years ago

Solved


Distance between two GPS Coordinates
A problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GI...

5 years ago

Solved


Avalaible area: wall construction
You need to build a wall to enclose a certain area. Calculate the available area after you build the wall. Assumptions * ...

5 years ago

Solved


Pairwise Euclidean Distance
Given two matrices A,B of dimensions NxK and NxL respectively, calculate the pairwise euclidean distance of all vectors (columns...

5 years ago

Solved


Vector parallel to plane?
Given the coefficients of the equation which defines a plane as follows: ax+by+cz=d, return a boolean indicating whether the 2n...

5 years ago

Solved


Slicing the cube
A bored matlab enthusiast has a cube with volume n^3. He decides to paint the entire surface of the cube red. Then, with slices...

5 years ago

Solved


Parallel vectors
Return true or false depending on whether 2 vectors are parallel or not. Vectors can be 2 or 3 dimensional. The origin is not c...

5 years ago

Answered
y coordinates of center of buoyancy
Is this what you want? x = [-8,-8,-6,0,6,8,8,-8]; y = [10,5,1,0,1,5,10,10]; ship=polyshape(x,y); figure(1) clf hold on p...

5 years ago | 0

Solved


Get ranking of a combination looking for speed.
I have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13]; They are then ordered from least to...

5 years ago

Solved


Get ranking of a combination
I have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13]; They are then ordered from least to...

5 years ago

Solved


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

5 years ago

Solved


Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

5 years ago

Solved


Project Euler: Problem 8, Find largest product in a large string of numbers
Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

5 years ago

Solved


Project Euler: Problem 5, Smallest multiple
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smalle...

5 years ago

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

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

5 years ago

Solved


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

5 years ago

Load more