Solved

01 - Scalar variables
Create the following variables: <<http://samle.dk/STTBDP/Assignment1_1.png>>

Solved

02 - Vector Variables 3
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2c.png>> (all the numbers from 5 to -5 in increments of ...

Solved

Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

Solved

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

Solved

Max of a Vector
Write a function to return the max of a vector

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

Solved

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

Solved

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

Solved

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

Solved

Power Numbers
Find the n-th power of m.

Solved

Area of a disk
Find the area of a disk or circle. x= radius of the disk.

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

Solved

ASCii Code
Using matlab, give the symbol that is associated with ASCii code 122

Solved

Divide by 4
Given the variable x as your input, divide it by four and put the result in y.

Solved

find the surface area of a cube
given cube side length x, find the surface area of the cube, set it equal to y

Solved

Find the area of the circle
geometry

Solved

Celsius to Kelvin
Convert Celsius degrees to Kelvin temperature.

Solved

Convert Fahrenheit to Celsius
Calculate the Celsius temperature C given the Fahrenheit temperature F. Examples: Input F = 90 Output C is 32.22 I...

Solved

y equals x divided by 2
function y = x/2

Solved

Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

Solved

Perimeters/Circumference
Given an array. Determine whether the perimeter is of a circle, triangle or square. Then calculate the perimeter.

Solved

Kinetic Energy
Given the mass m and velocity v of an object, determine its <http://en.wikipedia.org/wiki/Kinetic_energy kinetic energy>.

Solved

Transpose
Write a MATLAB script in order to convert a random length row vector (v) into a column vector.

Solved

length of a vector
Find twice the length of a given vector.

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

Solved

Weighted average
Given two lists of numbers, determine the weighted average as follows Example [1 2 3] and [10 15 20] should result in 33.3...

Solved

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

Solved

Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

Solved

Solve a System of Linear Equations
Example: If a system of linear equations in x₁ and x₂ is: 2x₁ + x₂ = 2 x₁ - 4 x₂ = 3 Then the coefficient matrix (A) is: 2 ...