解決済み


Replace secondary diagonal elements of a square array
Replace all the secondary diagonal elements of the square array A with the number n Example: A=[1 2 3; 4 5 6; 7 8 ...

8年以上 前

解決済み


Find Missing Number
A little problem (inspired by CodeChef) for the coffee break. A friend give you an array of size n-1 integers and these int...

8年以上 前

解決済み


Change number representation to HEX
Given a number change it's representation to HEX and output it.

8年以上 前

解決済み


Divide elements by sum of elements
In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

8年以上 前

解決済み


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

8年以上 前

解決済み


Print the date for a given number using Indian calendar reference
Print date for a given number in date reference is INDIAN calendar, not Christ's Birth The Vikram Samvat is said to have been...

8年以上 前

解決済み


Polynomial Evaluation
Create a routine that takes a list of coefficients of a polynomial in order of increasing powers of x; together with a value of ...

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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.

8年以上 前

解決済み


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

8年以上 前

解決済み


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]

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

8年以上 前

解決済み


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

8年以上 前

解決済み


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

8年以上 前

解決済み


rounding numbers toward zero
round any number toward zero ex. 4.5=4 4.7=4 5.2=5

8年以上 前

解決済み


MATLAB Basic: rounding IV
Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

8年以上 前

解決済み


MATLAB Basic: rounding III
Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8

8年以上 前

さらに読み込む