A résolu


Matrix with different incremental runs
Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

2 mois il y a

A résolu


Set some matrix elements to zero
First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

2 mois il y a

A résolu


Some Assembly Required
The input to this function is a matrix of real numbers. Your job is to assemble the rows of the matrix into one large row that ...

2 mois il y a

A résolu


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

2 mois il y a

A résolu


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

2 mois il y a

A résolu


Make an awesome ramp for a tiny motorcycle stuntman
Okay, given a vector, say v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 3 6 9 11 0; 6 9 ...

2 mois il y a

A résolu


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

2 mois il y a

A résolu


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

2 mois il y a

A résolu


N-Dimensional Array Slice
Given an N-dimensional array, _A_, an index, _I_, and a dimension, _d_, return the _I_ th elements of _A_ in the _d_ dimension. ...

2 mois il y a

A résolu


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

2 mois il y a

A résolu


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

2 mois il y a

A résolu


Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

2 mois il y a

A résolu


Missing five
Convert decimal numbers to a base-9 notation missing the digit *5* <<http://www.alfnie.com/software/missing5.jpg>> Too man...

2 mois il y a

A résolu


Polarisation
You have n polarising filters stacked one on top of another, and you know each axis angle. How much light gets passed through th...

2 mois il y a

A résolu


Octoberfest festival
A group of students decided to visit Octoberfest festival. First they ordered one beer, then after half-hour they taken one more...

2 mois il y a

A résolu


Circle/Pentagon Overlap
Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

2 mois il y a

A résolu


Inscribed Pentagon?
Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

2 mois il y a

A résolu


Is this is a Tic Tac Toe X Win?
For the game of Tic Tac Toe we will be storing the state of the game in a matrix M. For this game: We would store the state ...

2 mois il y a

A résolu


Pentagonal Numbers
Your function will receive a lower and upper bound. It should return all pentagonal numbers within that inclusive range in ascen...

2 mois il y a

A résolu


I Plead the Fifth
Write a function to provide a yes or no answer to the input string. However, it must plead the 5th amendment (return an empty st...

2 mois il y a

A résolu


The Top 5 Primes
This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

2 mois il y a

A résolu


Breaking Out of the Matrix
Do you want to take the Red Pill, or the Blue Pill? If you take the Blue Pill, you will simply pass along to the next problem...

2 mois il y a

A résolu


Energy of a photon
&#9883 &#9762 &#9883 &#9762 &#9883 &#9762 &#9883 Given the frequency F of a photon in giga hertz. Find energy E of this photon...

2 mois il y a

A résolu


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

2 mois il y a

A résolu


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

2 mois il y a

A résolu


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

2 mois il y a

A résolu


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

2 mois il y a

A résolu


Return the first and last characters of a character array
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

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

2 mois il y a

A résolu


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to find the logical indices o...

2 mois il y a

Charger plus