Community Profile

Contact

Top 5% contributor

It might be an overkill in this case, but I think that interp2 can do the trick for you

0

Answered 1 year ago

Make a function which gets a vector and creates all combinations, then call it 3 times: B1 = combinations(A(1,A(:,2)==2)); ...

First, read the file into cell-array of strings by running "fgetl" in a loop, then find the relevant 'OUTPUT %d for p=%2f' line ...

2 downloads

2 years ago

1 downloads

Given a vector v of integers and an integer n, return the the indices of v (as a row vector in ascending order) that sum to n. I...

Solve this!

1 year ago

Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...

Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...

Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

Given the input n, return true if n is odd or false if n is even.

Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

Given a and b, return the sum a+b in c.

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

0 downloads

Load more

Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a location from the following list:

See all countries