Problem

ascii

Using matlab, give the symbol that is associated with ASCii code 101.

5 years ago | 0 | 2 solvers

Problem

logarithm

Write a script that returns the logarithm of the elements in x. e.g. x = [1 2 3 4 5] --> y = [0 0.3010 0.4771 0.6021 0.6990]

5 years ago | 0 | 0 solvers

Problem

evaluating a polynomial

Given the following polynomial and the value for x, determine y. y = 2x^3 – x^2 – 4x + 2

5 years ago | 0 | 0 solvers

Problem

subtract two numbers

Given a and b, return the difference a-b in c.

5 years ago | 0 | 6 solvers

Problem

the difference of cubes

Given a and b, return the difference of cubes a^3 - b^3 in c.

5 years ago | 0 | 6 solvers

Problem

a matrix of ones

Given an input x, create a square matrix y of ones with x rows and x columns.

5 years ago | 0 | 0 solvers

Problem

the odd elements

Write a function which extracts all the odd elements. example input: x = [1 8 9 45 -2 4] output: y = [1 9 -2]

5 years ago | 0 | 2 solvers

Problem

complex numbers

For complex number z=a+bi, write code that will multiply a and b together.

5 years ago | 0 | 8 solvers

Problem

a column vector to a row vector

Write a script to convert a column (e.g. x = [1; 2; 3]) to a row (e.g. y = [1 2 3]), your script should be able to do this for a...

5 years ago | 0 | 8 solvers

Problem

a vector with a repeated entry

Create a row vector of length x, filled with 7's, for example, if x = 5 output = [7 7 7 7 7] make sure to round UP when x ...

5 years ago | 0 | 7 solvers

Problem

intervals

Write a function that takes an interval from a to b, and divides it into 6 parts.

5 years ago | 0 | 57 solvers

Solved

Select every other element of a vector

Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

5 years ago

Solved

Create a Matrix of Zeros

Given an input x, create a square matrix y of zeros with x rows and x columns.

5 years ago

Solved

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

5 years ago

Solved

Times 2 - START HERE

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

5 years ago

Solved

Matlab Basics - y as a function of x

Write a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2

5 years ago

Solved

Evaluating a polynomial

Given the following polynomial and the value for x, determine y. y = 3x^5 – x^3 + 8x – 3 Example x = 1 y = 3 - 1 +...

5 years ago

Solved

Complex number

For complex number c=a+bi, write code that will add a and b together.

5 years ago

Solved

Matlab Basics - Convert a row vector to a column vector

Write a script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any...

5 years ago

Solved

Area of a circle

Given the radius x, y would be the area of a circle. Pi = 3.1416

5 years ago

Solved

Matlab Basics II - Create a vector with a repeated entry

Create a row vector of length n, filled with 4's, for example, if n = 3 output = [4 4 4] make sure to round UP when n is a...

5 years ago

Solved

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

If x = 5, y = 5 * (5+5) * 5 = 250

5 years ago

Solved

Matlab Basics II - Intervals

Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

5 years ago

Solved

Matlab Basics II - squares

Write a function that takes matrix A, and squares each element in the matrix example: A = [1 2 3] output = [1 4 9]

5 years ago

Solved

Matlab Basics - Rounding I

Write a script to round x DOWN to the next lowest integer: e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2

5 years ago