解決済み

Maximum value in a matrix

Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

Determine Whether an array is empty

Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

4ヶ月 前

解決済み

Swap the input arguments

Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

Replace May with April

For instance, if the input is input_str = 'The flowers may bloom in April'; then the output is output_str = 'The flo...

4ヶ月 前

解決済み

Relative ratio of "1" in binary number

Input(n) is positive integer number Output(r) is (number of "1" in binary input) / (number of bits). Example: * n=0; r=...

4ヶ月 前

解決済み

Check that number is whole number

Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...

4ヶ月 前

解決済み

Basics: 'Find the eigenvalues of given matrix

Find the eigenvalues y for a given matrix x.

4ヶ月 前

解決済み

Simple equation: Annual salary

Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

4ヶ月 前

解決済み

Nearest Numbers

Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

4ヶ月 前

解決済み

The Hitchhiker's Guide to MATLAB

Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

Back and Forth Rows

Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

Summing digits

Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

Length of the hypotenuse

Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

Remove any row in which a NaN appears

Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

Find the longest sequence of 1's in a binary sequence.

Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

MATLAB Counter

Write a function f = counter(x0,b) to construct a counter handle f that counts with an initial value x0 and a step size b. E...

4ヶ月 前

解決済み

Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.

Submit your answer to this problem a multiple of 5 seconds after the hour. Your answer is irrelevant; the only thing that matte...

4ヶ月 前