Solved


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

14 years ago

Solved


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

14 years ago

Solved


Find state names that start with the letter N
Given a list of US states, remove all the states that start with the letter N. If s1 = 'Alabama Montana Nebraska Vermont Ne...

14 years ago

Solved


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

14 years ago

Solved


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

14 years ago

Answered
Separating the channels of a .wav sound file
If the .wav file is a stereo audio file, then <http://www.mathworks.com/help/techdoc/ref/wavread.html |wavread|> can read them i...

14 years ago | 1

| accepted

Answered
Memory
That's the theoretical limit that MATLAB can access on your 64-bit system, which is independent of how much RAM and Swap you hav...

14 years ago | 1

Solved


Clean the List of Names
Given a list of names in a cell array, remove any duplications that result from different capitalizations of the same string. So...

14 years ago

Solved


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

14 years ago

Solved


Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix. For example, given A = 1 2 3 5 ...

14 years ago

Solved


Renaming a field in a structure array
MATLAB has a <http://www.mathworks.com/help/techdoc/ref/setfield.html setfield> and a <http://www.mathworks.com/help/techdoc/ref...

14 years ago

Solved


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

14 years ago

Answered
Last non nan observation
I'm not sure if you're looking for the indices (row number) or the actual value of the last non nan observation. So here are bot...

14 years ago | 4

| accepted

Answered
Why use x=load('myFile.mat')?
You may actually get an incorrect answer in certain situations. For example, create a MAT file, myFile.mat, that has a variab...

14 years ago | 5

| accepted

Published


Looking Back: 2011 in Review
Having recently wrapped up another great year for the File Exchange (a year in which we saw the number of...

14 years ago

Thumbnail

Answered
Coloring scatterplots based on frequency of point occurrence in input
*EDIT: |unique| instead of |sort|* You should be able to do it with: |unique| (use the 'rows' parameter) |hist| (use th...

14 years ago | 4

| accepted

Published


Finding the best distribution that fits the data
Jiro's pick this week is allfitdist by Mike Sheppard. As an application engineer, I go out and deliver...

14 years ago

Thumbnail

Answered
Plot using scatter3 function.
Is this what you're looking for? x = rand(1,24); y = rand(1,24); z = rand(1,24); sz = 40; colors = jet(24); ...

14 years ago | 1

Solved


Return the 'Size' of a String of Code
One of the most 'mysterious' parts of playing Cody is the sizing system. Given a string of commands, return the size that Cody w...

14 years ago

Published


Units Conversion Toolbox
Brett's Pick this week is Units Conversion Toolbox, by John McDermid. Once, a long time ago, I was a real...

14 years ago

Thumbnail

Solved


wait for me
wait exactly x seconds please, need not be more than 2 seconds but must be accurate within say 50 milliseconds, your function mu...

14 years ago

Solved


Is my wife right?
Regardless of input, output the string 'yes'.

14 years ago

Published


A non-engineer tinkers with Simulink
Greg's pick this week is A non-engineer tinkers with Simulink by Dimitri Shvorob. Contents ...

14 years ago

Thumbnail

Solved


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

14 years ago

Solved


Counting in Finnish
Sort a vector of single digit whole numbers alphabetically by their name, in Finnish. See the Wikipedia page for <http://en.wik...

14 years ago

Solved


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

14 years ago

Solved


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

14 years ago

Solved


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

14 years ago

Solved


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

14 years ago

Solved


Make a checkerboard matrix
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...

14 years ago

Load more