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

ungefär 2 år 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....

ungefär 2 år 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: * ...

ungefär 2 år 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...

ungefär 2 år 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...

ungefär 2 år 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...

ungefär 2 år 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'

ungefär 2 år 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...

ungefär 2 år 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: ...

ungefär 2 år 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...

ungefär 2 år ago

Solved


Knight Moves?
One of my favorite games are chess. Let’s do something with chess. If you don’t know chess, that’s completely fine. You can stil...

ungefär 2 år ago

Problem


Knight Moves?
One of my favorite games are chess. Let’s do something with chess. If you don’t know chess, that’s completely fine. You can stil...

ungefär 2 år ago | 1 | 13 solvers

Solved


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

ungefär 2 år ago

Solved


Magic!
Check whether the input matrix is a normal magic square: <http://en.wikipedia.org/wiki/Magic_square> Output the logical va...

ungefär 2 år ago

Solved


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

ungefär 2 år ago

Solved


文字列の最初と最後の文字だけ抜き出しましょう。
文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。 もし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。 例: stringfirstandlast('borin...

ungefär 2 år ago

Solved


Extract the prime numbers
Given a list of elements, extract the prime numbers from that array.

ungefär 2 år ago

Problem


Extract the prime numbers
Given a list of elements, extract the prime numbers from that array.

ungefär 2 år ago | 0 | 22 solvers

Solved


Find alternating sum
Given an array, find alternating sum i.e. – y = x (1) – x (2) + x (3) – x (4) + x (5) - …

ungefär 2 år ago

Problem


Find alternating sum
Given an array, find alternating sum i.e. – y = x (1) – x (2) + x (3) – x (4) + x (5) - …

ungefär 2 år ago | 0 | 20 solvers

Solved


Play with array Min-Max
An array is provided. For example, a= [ 2,1,11,4,5,13] Create an array from a like this way, out= [ 1,11,2,13,4,5] ➢ 1st take...

ungefär 2 år ago

Problem


Play with array Min-Max
An array is provided. For example, a= [ 2,1,11,4,5,13] Create an array from a like this way, out= [ 1,11,2,13,4,5] ➢ 1st take...

ungefär 2 år ago | 0 | 12 solvers

Solved


Given a matrix X, manipulate it accordingly
Given a matrix X, 1st add a column to the matrix whose elements are the summation of each rows. Then add a row to the matrix who...

ungefär 2 år ago

Problem


Given a matrix X, manipulate it accordingly
Given a matrix X, 1st add a column to the matrix whose elements are the summation of each rows. Then add a row to the matrix who...

ungefär 2 år ago | 0 | 18 solvers

Solved


An array is given. Find the unique elements of the array. [keep the sequence unchanged]
An array is given. Find the unique elements of the array. [keep the sequence unchanged] For example if input x=[2 ,4 , 9 ,2 ,...

ungefär 2 år ago

Problem


An array is given. Find the unique elements of the array. [keep the sequence unchanged]
An array is given. Find the unique elements of the array. [keep the sequence unchanged] For example if input x=[2 ,4 , 9 ,2 ,...

ungefär 2 år ago | 0 | 50 solvers

Solved


An array is given that contains the marks received by a group of students in their class test. Find out the highest 3 marks received by the students?
An array is given that contains the marks received by a group of students in their class test. Find out the highest 3 marks rec...

ungefär 2 år ago

Problem


An array is given that contains the marks received by a group of students in their class test. Find out the highest 3 marks received by the students?
An array is given that contains the marks received by a group of students in their class test. Find out the highest 3 marks rec...

ungefär 2 år ago | 0 | 22 solvers

Solved


チェッカーボードを作ろう
整数 n が与えられた時、以下の様な1と0を含むn×nの行列を作成しましょう。a(1,1) は1にする必要があります。 例: 入力 n = 5 出力 a が [1 0 1 0 1 0 1 0 1 0 ...

mer än 2 år ago

Solved


サイコロを作ろう
1から6までの独立かつランダムな数値を返すような関数を作成しましょう。 例: >> [x1,x2] = rollDice(); と入力すると x1 = 5 x2 = 2 のような解を返します。

mer än 2 år ago

Load more