解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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.

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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.

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

解決済み


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

3年弱 前

さらに読み込む