A résolu


Matrix of almost all zeros, except for main diagonal
Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

plus de 10 ans il y a

A résolu


Get all corner elements from a matrix where dimension of matrix is always equal to or greater than 2.
if a given matrix a = [1 2 3;4 5 6]; so answer is going to be [1 3;4 6]

plus de 10 ans il y a

A résolu


What's the missing interior angle?
I'm talking about polygons... The sum of the interior angles of a triangle is 180 degrees. The sum of the interior angles of a...

plus de 10 ans il y a

A résolu


Histogram of histogram
Histogram of histogram (HoH) is a useful measure concerning the distribution of random data, which has diverse applications in d...

plus de 10 ans il y a

A résolu


print date for a given number in date reference is INDIAN calendar,not Christ's Birth.
The Vikram Samvat is said to have been founded by the emperor Vikramaditya of Malwa following his victory over the Sakas in 56 Y...

plus de 10 ans il y a

A résolu


For a given linear index as input for n sized square matrix, find corresponding row and column.
If input is 1, the row and column will be 1 and 1 respectively.

plus de 10 ans il y a

A résolu


Can you reshape the matrix?
Given a matrix A, is it possible to reshape it into another matrix with the given number of rows?

plus de 10 ans il y a

A résolu


Longest Collatz Sequence
Inspired by Projet Euler n°14. The Collatz iterative sequence (See Cody problem n° 2103 and 211) is defined for the set of po...

plus de 10 ans il y a

A résolu


unique with nan
input x = [2 NaN 3 5 NaN; 1 NaN 4 9 NaN; 8 -2 7 6 -2; 7 4 8 5 4]; output y_correct = [2 ...

plus de 10 ans il y a

A résolu


longest sequence of nans
In an array return the length of longest sequence of nans for each column. x = [ 2 3 1 2 5 6; nan nan 5 n...

plus de 10 ans il y a

A résolu


If you prick us, do we not bleed?
While doing some quick sewing to fix up your child's Halloween costume, you accidentally jab your finger with the needle. Refle...

plus de 10 ans il y a

A résolu


replace nan values iteratively.
replace nan values with the average of two neighbour non-nan value iteratively as follow; x = [2; 4; 6; nan; nan; nan; 10]; ...

presque 11 ans il y a

A résolu


sort matrix
Given a matrix, sort it for each column, but cannot change the element of each row. for example input = [1 3; 2 4;1 5;3 6]; ...

presque 11 ans il y a

A résolu


Knave in the middle attack
This is a Matlab adaptation of the <http://en.wikipedia.org/wiki/Knights_and_Knaves Knives and Knaves> logical puzzles, mixed wi...

presque 11 ans il y a

A résolu


UICBioE240 2.6
Given a row vector containing all x1, and a column vector containing all x2, and their lengths are equal, create a column vector...

presque 11 ans il y a

A résolu


Order of things - 2
This problem is closely related to <http://www.mathworks.nl/matlabcentral/cody/problems/2189-order-of-things-1 Problem 2189, Ord...

presque 11 ans il y a

A résolu


Kwabna
add two numbers

presque 11 ans il y a

A résolu


Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n. Example For n = 2 then sum of squares = 5 (1^2 + ...

presque 11 ans il y a

A résolu


the number of inputs
Find the number of the inputs of the function. example y = theinputnumber(x,k); function called theinputnumber has 2 in...

presque 11 ans il y a

A résolu


add two values
add two values

presque 11 ans il y a

A résolu


I want 50 values from 0 to pi
ExampleA = linspace(a,b,c)

presque 11 ans il y a

A résolu


Add two to x
Create a script such that y equals x plus 2

presque 11 ans il y a

A résolu


Recursion - Fun
Generate the first k terms in the sequence a(n) define recursively by a(n+1)=p*a(n)+(1+a(n)) with p=0.9 and a(1)=0.5 ...

presque 11 ans il y a

A résolu


Determine if the sum of y is greater than the sum of x.
Given the vector x and the vector y, determine which sum is greater.

presque 11 ans il y a

A résolu


Convert yards to feet
The goal of this script is to convert a value given in yards to feet.

presque 11 ans il y a

A résolu


become the batman and save gotham!!!
:\\YOU ARE THE BATMAN//: Batman needs your help to save gotham city from its villains! One day while patrolling the streets...

presque 11 ans il y a

A résolu


Place numbers
Given two input first input is a matrix which consist of the index numbers of the second input vector. You place the second inpu...

presque 11 ans il y a

A résolu


Generate the sum of Squares of the given number
|P(n) = 1^2 + 2^2 + ... + n^2| |P(1) = 1| |P(2) = 1 + 4 = 5;| |P(3) = 5 + 9 = 14;| |P(4) = 14 + 16 = 30;|

presque 11 ans il y a

A résolu


Test Problem; Create a 5x5 array containing all ones
This is a test for learning the process of creating a Cody problem. The goal of this test problem will be to create an array,...

presque 11 ans il y a

A résolu


Matrix FUN
Given a Matrix M, find out the number of elements of matrix that are divisible by 3. M = [1 2 3;4 5 6;7 8 9]; ou...

presque 11 ans il y a

Charger plus