Risolto


Create a code for XNOR
Given two inputs, output XNOR of those two

circa 2 anni fa

Risolto


Rotate Matrix Depending on the input
Rotate matrix (CounterClockwise) via 90, 180 or -90 depending on the input Ex. a = [1 2 3; 4 5 6; 7 8 9] b = 90; ...

circa 2 anni fa

Risolto


Odd times even numbers in a matrix
First count the number of odd numbers in x, then the number of even. Return their product. example: x = [1 2] One odd ...

circa 2 anni fa

Risolto


Add the even numbers
Add only the even numbers of x example: x = [1 2 3 4 5] the positive numbers are: 2 4, so their sum is 6

circa 2 anni fa

Risolto


Add the positive numbers
Add only the positive numbers of x example: x = [-2 -1 0 1 2 3] the positive numbers are: 1 2 3, so their sum is 6

circa 2 anni fa

Risolto


Find the volume of cone
Find the volume of cone, when given radius(r) and height(h).

circa 2 anni fa

Risolto


Maximum of ND-array
Find the maximum element of a N dimensional array. Example: A=[1 2 4 ; -20 4 10]; The maximum is 10.

circa 2 anni fa

Risolto


Construct a "diagAdiag" matrix
Construct a matrix whose elements begin from 1 and end at n^2 with the order of arrangement as shown below: For: n = 4 ...

circa 2 anni fa

Risolto


Vector push
Append an element |x| to the end of the vector |v| and return both the extended vector and the new number of its elements. |x| c...

circa 2 anni fa

Risolto


Triangle of numbers
Create a matrix with the integers from 1 to |n| arranged in a triangular shape. Every row |i| of the matrix contains |i| inte...

circa 2 anni fa

Risolto


Find the best name there is for a nice guy
Try to come up with the best possible name for a nice and funny male person.

circa 2 anni fa

Risolto


Draw a 'Z'.
Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ . Example: n=5 ans= [1 1 1 1 1 0 0 0 1 ...

circa 2 anni fa

Risolto


Draw a 'X'!
Given n as input Draw a 'X' in a n-by-n matrix. example: n=3 y=[1 0 1 0 1 0 1 0 1] n=4 y=[1 0 0...

circa 2 anni fa

Risolto


Draw 'O' !
Given n as input, generate a n-by-n matrix 'O' using 0 and 1 . example: n=4 ans= [1 1 1 1 1 0 0 1 ...

circa 2 anni fa

Risolto


Draw a 'N'!
Given n as input, generate a n-by-n matrix 'N' using 0 and 1 . Example: n=5 ans= [1 0 0 0 1 1 1 0 0 1 1 0 ...

circa 2 anni fa

Risolto


Draw 'J'
Given n as input, generate a n-by-n matrix 'J' using 0 and 1 . Example: n=5 ans= [0 0 0 0 1 0 0 0 0 1 0 0 ...

circa 2 anni fa

Risolto


Draw 'I'
Given n as input, draw a n-by-n matrix 'I' using 0 and 1. example: n=3 ans= [0 1 0 0 1 0 0 1 0] n=...

circa 2 anni fa

Risolto


Draw 'H'
Draw a x-by-x matrix 'H' using 1 and 0. (x is odd and bigger than 2) Example: x=5 ans= [1 0 0 0 1 1 0 0 0 1 ...

circa 2 anni fa

Risolto


Draw 'F'
Draw a x-by-x matrix 'F' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

circa 2 anni fa

Risolto


Draw 'E'
Draw a x-by-x matrix 'E' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

circa 2 anni fa

Risolto


Draw 'D'.
Draw a x-by-x matrix 'D' using 0 and 1. example: x=4 ans= [1 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0]

circa 2 anni fa

Risolto


Draw 'C'.
Given x as input, generate a x-by-x matrix 'C' using 0 and 1. example: x=4 ans= [0 1 1 1 1 0 0 0 ...

circa 2 anni fa

Risolto


Draw 'B'
Draw a x-by-x matrix 'B' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 0 1 0 0 0 1 ...

circa 2 anni fa

Risolto


Toeplitize a matrix
Similar to <http://www.mathworks.com/matlabcentral/cody/problems/3094-hankelize-a-matrix Problem 3094. Hankelize a matrix>, now ...

circa 2 anni fa

Risolto


Write a function man that takes a row vector v and returns a matrix H as follows..
Write a function called man that takes a row vector v as an input and returns a matrix H whose first column consist of the eleme...

circa 2 anni fa

Risolto


Hankelize a matrix
Similar to <http://www.mathworks.com/matlabcentral/cody/problems/42501-toeplitize-a-matrix Problem 42501. Toeplitize a matrix>, ...

circa 2 anni fa

Risolto


Must be in the front row...
You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...

circa 2 anni fa

Risolto


Go to the head of the class!
You're given a matrix and a single number. If that number is in the matrix, reorder the matrix so that number is in the first r...

circa 2 anni fa

Risolto


Magnet and Iron
(Inspired from <http://www.mathworks.com/matlabcentral/cody/problems/112 Problem 112: Remove the air bubbles>) Iron (atomic n...

circa 2 anni fa

Risolto


Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

circa 2 anni fa

Carica altro