A résolu


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

plus de 14 ans il y a

A résolu


Sort a list of complex numbers based on far they are from the origin.
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...

plus de 14 ans il y a

A résolu


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

plus de 14 ans il y a

A résolu


Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

plus de 14 ans il y a

A résolu


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

plus de 14 ans il y a

A résolu


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

plus de 14 ans il y a

A résolu


Most nonzero elements in row
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...

plus de 14 ans il y a

A résolu


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

plus de 14 ans il y a

A résolu


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

plus de 14 ans il y a

A résolu


Given two strings, find the maximum overlap
Given two strings s1 and s2, create a new string s3 which is as short as possible and contains both strings. If s1 = [1 2...

plus de 14 ans il y a

A résolu


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

plus de 14 ans il y a

A résolu


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

plus de 14 ans il y a

A résolu


Get the area codes from a list of phone numbers
Given a string of text with phone numbers in it, return a unique'd cell array of strings that are the area codes. s = '508-647...

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

Réponse apportée
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...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 1

A résolu


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

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

Réponse apportée
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...

plus de 14 ans il y a | 4

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 5

| A accepté

Publié le


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

plus de 14 ans il y a

Thumbnail

Réponse apportée
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...

plus de 14 ans il y a | 4

| A accepté

Publié le


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

plus de 14 ans il y a

Thumbnail

Charger plus