Solved

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.

6 días ago

Solved

Natural numbers in string form

Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

6 días ago

Solved

String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values

<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

6 días ago

Solved

Fix the last element of a cell array

Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

6 días ago

Solved

Cell Counting: How Many Draws?

You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

6 días ago

Solved

Remove element(s) from cell array

You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

6 días ago

Solved

Convert a numerical matrix into a cell array of strings

Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

6 días ago

Solved

Split a string into chunks of specified length

Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

6 días ago

Solved

Convert a Cell Array into an Array

Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

6 días ago

Solved

Create a cell array out of a struct

Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

6 días ago

Solved

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

6 días ago

Solved

Function Iterator

Given a handle fh to a function which takes a scalar input and returns a scalar output and an integer n >= 1, return a handle f...

7 días ago

Solved

Binary numbers

Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

7 días ago

Solved

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

7 días ago

Solved

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

7 días ago

Solved

Counting Money

Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

7 días ago

Solved

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

7 días 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...

7 días ago

Solved

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

7 días ago

Solved

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

7 días 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...

7 días ago

Solved

Bullseye Matrix

Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

7 días ago

Answered

Invalid training data. The output size (2) of the last layer does not match the number of classes (6).

Hi Aswin, The number of outputs from your network would be determined by the last fullyConnectedLayer you have used. Since it h...

Invalid training data. The output size (2) of the last layer does not match the number of classes (6).

Hi Aswin, The number of outputs from your network would be determined by the last fullyConnectedLayer you have used. Since it h...

7 días ago | 0

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

8 días ago

Solved

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

8 días ago

Solved

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

8 días 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...

8 días ago

Solved

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

8 días ago

Solved

Remove all the consonants

Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

8 días ago