Solved


Add Me To Death (Sum sum sum)
Given certain vector, sum of the input vector, get the sum of 2 adjacent numbers in the input, and sum of the output vector (wh...

8 years ago

Solved


pizza deals
Given two pizza slices of different sizes: * Slice A with angle alpha1, radius r1, and price p1 * Slice B with angle alpha2,...

8 years ago

Solved


Use R2016b Text Manipulations to Fix These Addresses (Part 3)
We have a series of addresses like the following which we'd like to reformat. Each of the addresses lacks a space and a comma ...

8 years ago

Solved


Use R2016b Text Manipulations to Fix These Addresses (Part 2)
We have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Mass...

8 years ago

Solved


Use R2016b Text Manipulations to Fix These Addresses (Part 1)
We have a series of addresses like the following which we'd like to reformat. Can you remove the latitude and longitude from the...

8 years ago

Solved


Find parts of a circle.
Given radius (r) of a circle find the diameter (d), circumference (c), an area (a).

8 years ago

Solved


Union Jack Matrix
Create a matrix of odd dimensions that has ones on both diagonals and dividing the matrix into 4 quadrants, resembling a square ...

8 years ago

Solved


Tent matrix
Create an n x n matrix that resembles one kind of tent. The variable n is provided to the function and will be an odd number. As...

8 years ago

Solved


Form a square matrix from four square sub-matrices
Create a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4): y = [x1 x2; x3 x4]; ...

8 years ago

Solved


Create a square matrix with given conditions
Create a square matrix, M, which should be populated as follows: M = [ n^2 n * (n-1) n * (n-2) ... n * 2 n * ...

8 years ago

Solved


create a square matrix
create a [n*n] matrix. example: mat(4)= [ 1 4 9 16 4 4 9 16 9 9 ...

8 years ago

Solved


How to reverse spdiags ?
The spdiags function extracts all nonzero diagonals from the m-by-n matrix A. So if A=[1 2 3;4 5 6;7 8 9], spdiags(A)=[7 4...

8 years ago

Solved


Combine Data With Gaps
Combine data sets a and b where the datasets have "gaps" or unique points. Example: Input a = [1,0; 2,1; ...

8 years ago

Solved


Find the same and successive values in a vector
Find the same and successive values in a vector. For example: Input x = [ 1 0 0 1 1 1 1 0 1 1 1 0 0 0 1 ] Start and end...

8 years ago

Solved


How close to a hole
Suppose you have a description of good places (ones) and bad places (zeros). You want to know your distance from a bad place (in...

8 years ago

Solved


Split array into pieces according to corresponding array
An array x of length n has values 1...m with each value appearing at least once. The values are sorted (n>=m). A second...

8 years ago

Solved


Find the distance between runs
Another question inspired by the <http://uk.mathworks.com/matlabcentral/answers/?s_tid=gn_mlc_an answers forum>: A vector of ...

8 years ago

Solved


Find Elements in Range
Based on a question on <http://www.mathworks.com/matlabcentral/answers/ MATLAB Answers>. Find all the elements of a vector wh...

8 years ago

Solved


Find indices of diagonal elements
Given a matrix A and a diagonal index d (where 0 indicates the main diagonal and off-diagonals are identified by positive and n...

8 years ago

Solved


Neither minima nor maxima
Input v is a vector. Return all the elements of v which are not a local minimum or maximum. Example: v = [1 2 3 4 5] Ou...

8 years ago

Solved


When Was That Goal Scored?
We want to find out when the goals were scored in a particular soccer game. For each game, we are given a "Goal Event Data" XML ...

8 years ago

Solved


Words Count: A Cell Array Approach
Given an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\n), arra...

8 years ago

Solved


Words Count: A String Array Approach
Given an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\n), arra...

8 years ago

Solved


Math with Roman Numerals
Given a function R within (+,-,*,/) and two Roman numerals a & b, compute aRb in Roman numerals.

8 years ago

Solved


Check if a matrix is a palindrome in all directions
Check if a matrix is a palindrome both vertically and horizontally. You function will return *true* for |[1,2,1]| or |[2,7,2;...

8 years ago

Solved


Two fractions, one sum
Given a positive number x, write a MATLAB script that will tell you how many ways that the reciprocal of that number can be writ...

8 years ago

Solved


Diophantine Equations (Inspired by Project Euler, problem 66)
Consider the quadratic Diophantine equation of the form: x^2 – Dy^2 = 1 When D=13, the minimal solution in x is 649^2 – 13...

8 years ago

Solved


Compute average gain for some bets.
Given a vector containg the odds of some events in decimal format (e.g., |odds=[1.3 2.5 1.5]| ) and a vector of the same dimensi...

8 years ago

Solved


Archimedes principle
According to Archimedes principle, the buoyancy force is equal to the weight of fluid displaced by the submerged portion of an o...

8 years ago

Solved


currency converter
given a rate of exchange calculate the equivalent units of 100 USD

8 years ago

Load more