Risolto


Speed of car
Calculate the Speed of car given its Distance travelled and time taken in x and y respectively

quasi 3 anni fa

Risolto


multiply by three
Given the variable x as your input, multiply it by 3 and put the result equal to y. Examples: Input x = 2 Output y is ...

quasi 3 anni fa

Risolto


Is it an Armstrong number?
An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. Fo...

quasi 3 anni fa

Risolto


Area of a Square
Inside a square is a circle with radius r. What is the area of the square?

quasi 3 anni fa

Risolto


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

quasi 3 anni fa

Risolto


Multiples of a Number in a Given Range
Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...

quasi 3 anni fa

Risolto


Is the input divisible by 3?
Return true if the input is divisible by 3 and false if not.

quasi 3 anni fa

Risolto


matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...

quasi 3 anni fa

Risolto


Temperature conversion
Convert temperature in degrees Celsius (C) to temperature in degrees Kelvin (K). Assume your answer is rounded to the nearest Ke...

quasi 3 anni fa

Risolto


Count ones
Write a program to count number of ones (1s) in an integer variable input. For example: Input x=2200112231 output y=3 I...

quasi 3 anni fa

Risolto


Square the input
Given a scalar or vector x, return the square of each element. Example x = [7 2] answer = [49 4]

quasi 3 anni fa

Risolto


Switch matrix to a column vector
for e.g. x = [1 2 3 4] y = 1 3 2 4

quasi 3 anni fa

Risolto


"mirror" matrix
Create n x 2n "mirror" matrix of this type: Examples For n = 2 m = [ 1 2 2 1 1 2 2 1 ] For n = 3 m = ...

quasi 3 anni fa

Risolto


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

quasi 3 anni fa

Risolto


Find the area of a triangle
Given a triangle with a base b and height h, return the triangle area.

quasi 3 anni fa

Risolto


Finding peaks
Find the peak values in the signal. The peak value is defined as the local maxima. For example, x= [1 12 3 2 7 0 3 1 19 7]; ...

quasi 3 anni fa

Risolto


Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

quasi 3 anni fa

Risolto


Simple equation: Annual salary
Given an hourly wage, compute an annual salary

quasi 3 anni fa

Risolto


Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

quasi 3 anni fa

Risolto


Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] is s...

quasi 3 anni fa

Risolto


Sum the numbers on the main diagonal
Sum the numbers on the main diagonal of an n-by-n matrix. For input: A = [1 2 4 3 6 2 2 4 7]...

quasi 3 anni fa

Risolto


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


Square Diagonal
If n is the given number, then make a diagonal matrix of size 2*2 with the square of that number.

quasi 3 anni fa

Risolto


Back to basics 11 - Max Integer
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

quasi 3 anni fa

Risolto


Compute LOG(1+X) in natural log
Compute LOG(1+X) in natural log

quasi 3 anni fa

Risolto


Min of a Matrix
Return the minimum value in the given matrix.

quasi 3 anni fa

Risolto


Factorial Numbers
Factorial is multiplication of integers. So factorial of 6 is 720 = 1 * 2 * 3 * 4* 5 *6 Thus 6 factorial = factorial(720)....

quasi 3 anni fa

Risolto


Find out magnitude of vector
Find out magnitude of vector. Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2) Please don't use sum function. If you l...

quasi 3 anni fa

Risolto


Element by element multiplication of two vectors
Given two input vectors, return the element-by-element product. Example A = [1 2 3] B = [7 3 1] The answer should be...

quasi 3 anni fa

Carica altro