Resuelto


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

casi 6 años hace

Resuelto


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

casi 6 años hace

Resuelto


kmph to mps
convert kilometer per hour to meter per second

casi 6 años hace

Resuelto


Trimming Spaces
Given a string, remove all leading and trailing spaces (where space is defined as ASCII 32). Input a = ' singular value deco...

casi 6 años hace

Resuelto


CONVERT TAN TO SIN
In a right angle triangle ABC given the tan(A) then find sin(A) For example tan(A)=3/4 then sin(A)=3/5

casi 6 años hace

Resuelto


Reverse a matrix
Its simple. You have to reverse a given matrix.

casi 6 años hace

Resuelto


Negative matrix
Change the sign of all elements in given matrix.

casi 6 años hace

Resuelto


surface of a spherical planet
you just discovered its circumference, that is the input.

casi 6 años hace

Resuelto


Mid-term report
You just got your mid-term report, but it's full of ones and twos :(. So before you give it to your parents, you change it, in o...

casi 6 años hace

Resuelto


Simple Matrix
Make the following matrix without typing it in one by one. [1 2 3; 2 4 6; 4 8 12] x=[1 2 3].

casi 6 años hace

Resuelto


Box
Give the volume of a box, x is equal to the body diagonal.

casi 6 años hace

Resuelto


Problem for beginners
Suppose that x is a column vector, with at least a length of 6. Delete the 2., 6., and the second last row. Example: X=[1;2;3...

casi 6 años hace

Resuelto


Problem for beginners
M is a nxm matrix. Swap the fist and the second last column with eachother. X=[1 2 3;4 5 6;7 8 9] Y=[2 1 3;5 4 6;8 7 9]

casi 6 años hace

Resuelto


Stairs
Make an n by n matrix, where the elements are ones and zeros. In the main diagonal, and under that, there should be only ones (...

casi 6 años hace

Resuelto


Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
The given function returns the index of the maximum value in a given matrix. such as X=[4,3,4,5,9,12,0,5] Ans= 6 if maxim...

casi 6 años hace

Resuelto


Square
X is a number, write a code, where Y should be the square of X.

casi 6 años hace

Resuelto


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

casi 6 años hace

Resuelto


Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.

casi 6 años hace

Resuelto


Basics: 'Find the eigenvalues of given matrix
Find the eigenvalues y for a given matrix x.

casi 6 años hace

Resuelto


Matrix problem for beginners
Make a matrix [0,0,0;1,1,1;2,2,2]. X=[0,1,2]

casi 6 años hace

Resuelto


Matrix for beginners
Multiply x and y elemwise.

casi 6 años hace

Resuelto


Create a square matrix of multiples
Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row. This also applies...

casi 6 años hace

Resuelto


sum of first 'n' terms
Given n=10, find the sum of first 'n' terms Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...

casi 6 años hace

Resuelto


Celsius to Kelvin
Convert Celsius degrees to Kelvin temperature.

casi 6 años hace

Resuelto


select the primes of a vector
Find the prime numbers in a vector

casi 6 años hace

Resuelto


Sum of odd numbers in a matrix
Find the sum of all the odd numbers in a matrix. Example x = [2 3 5 7 1 4 11] y = 27

casi 6 años hace

Resuelto


Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

casi 6 años hace

Resuelto


Vectors counting by 2
Create a vector numbers from 7 to 15 in increments of 2

casi 6 años hace

Resuelto


Write a code that will follow the equation y = x * (x + x) * x.
If x = 5, y = 5 * (5+5) * 5 = 250

casi 6 años hace

Resuelto


Perfect Square or not
find Given input x is perfect square or not,if yes then output y=1.else y=0

casi 6 años hace

Cargar más