Solved

Determine if input is odd or even

Determine if input is odd or even, sample problem

5 mois ago

Solved

Calculate the square of a number (Super Easy)

The goal is to calculate the square (y) of a number (x). Good way to start MatLab for beginners.

5 mois ago

Problem

Ratio between sum of primes and sum of factors

Write a function that calcualtes the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of ...

5 mois ago | 0

Problem

Ratio between sum of primer numbers and non-prime numbers

Write a function that calculates the ratio between the sum of the prime numbers lower or equal than x, and the sum of the non-pr...

5 mois ago | 0

Solved

Sum of a geometric series

Give the sum of the first 'n' terms of a geometric series, given 'a' as the first term and 'r' as the ratio.

5 mois ago

Problem

Sum of a geometric series

Give the sum of the first 'n' terms of a geometric series, given 'a' as the first term and 'r' as the ratio.

5 mois ago | 0

Problem

Get the value 100

Knowing that 123-45-67+89=100, write a function that gives this result for any order of the digits in the input. Otherwise, the ...

5 mois ago | 0

Problem

Get the mean digit

Write a function that gives the mean digit (round towards nearest integer) of an input and positive number. For example: x ...

5 mois ago | 0

Problem

Check if is a square

Given four coordinates, write a function to check if they form a square on the XY plane.

5 mois ago | 0

Solved

Calculate numerical integration.

x=0:0.01:1 y=@(x)x.^2 Using given two inputs(x and y), conduct numerical integration in x. (hint: trapz)

5 mois ago

Solved

Create a constant offset.

Add a constant offset to an array. Example a = [1 3 5 9] offset = 2 y = [3 5 7 11]

5 mois ago

Solved

Determinant of a 3x3 Matrix

Return the determinant of a 3x3 matrix. The built-in Matlab function det is not allowed.

5 mois ago

Solved

Sum of the Multiplication of Vectors

Given the vectors x and y as input, multiply the vectors and return the summation of its elements. Example: x = [1 2 ...

5 mois ago

Solved

Square the input

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

5 mois ago

Solved

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

5 mois ago

Solved

Eye Squared

For a positive integer |n| create the identity matrix with |n| elements. In case it is not possible to produce an identity ma...

5 mois ago

Solved

Building matrices

If you have matrix A, create matrix B using matrix A as an "element" A = [1 2 3 4; 5 6 7 8...

5 mois ago

Solved

Evaluate Polynomial

Given a polynomial equation coefficients in a vector p, you have to return its value at x. Example: For inputs p and x ...

5 mois ago

Solved

Change matrix to vector

Vector is a matrix whose size is 1 x n or n x 1. Change matrix to vector. x = 4 3 5 1 ...

5 mois ago

Solved

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

5 mois ago

Answered

Replacing elements of an array with a vector

Hi Greggory, According to the solution you show, you can get it by doing: a(:, a(1,:)==1) = [a; b ] Best regards, Jesús

Replacing elements of an array with a vector

Hi Greggory, According to the solution you show, you can get it by doing: a(:, a(1,:)==1) = [a; b ] Best regards, Jesús

5 mois ago | 0

Problem

Alternating 1´s and 0´s in a matrix

Given an odd number n, write a function that creates a matrix y with dimension nxn alternating 1's and 0's, and starting with 1 ...

5 mois ago | 0

Solved

Rotate a matrix for 180 degree

Rotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]

5 mois ago

Solved

Rotate matrix by -90 degrees

Rotate a Matrix by -90 degrees Example: X = 1 2 3 4 5 6 7 8 9 output = 7 4 ...

5 mois ago

Solved

Basic commands - rounding

make a function which will round to integer, which is nearer to zero. Example x=[-2.5 2]; y=[-2 2];

5 mois ago