A résolu


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...

environ 5 ans il y a

A résolu


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

environ 5 ans il y a

A résolu


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

environ 5 ans il y a

A résolu


given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

environ 5 ans il y a

A résolu


07 - Common functions and indexing 4
Define the matrix _cMat_: <<http://samle.dk/STTBDP/Assignment1_3c.png>> ( _cMat_ = 10x10 matrix where the numbers from 1 t...

environ 5 ans il y a

A résolu


Rounding
Round 10.67 and make 'y' equal to that number.

environ 5 ans il y a

A résolu


factorial of a number x
Factorial of a number x

environ 5 ans il y a

A résolu


04 - Scalar Equations 2
Define the variables a and b: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> <<http://samle.dk/STTBDP/Assignment1_4-b.png>...

environ 5 ans il y a

A résolu


Your favourite city!
Type your favourite city.

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

environ 5 ans il y a

A résolu


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

environ 5 ans il y a

A résolu


Back to Basics - Find no. of elements in a matrix?
Let A be a m*n matrix. Find the total no. of elements in A ? (Hint - formula based) A = [1 2 3;4 5 6]; output = 6

environ 5 ans il y a

A résolu


02 - Vector Variables 1
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2a.png>>

environ 5 ans il y a

A résolu


Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

environ 5 ans il y a

A résolu


Find Out sum of principal diagonal element of given matrix
Find out sum of principal diagonal element of given matrix If A=[1 0 0; 0 1 0;0 0 1], then answer must be 3.

environ 5 ans il y a

A résolu


Finding perimeter of a rectangle
A rectangle has a length of x centimeters and a width of w centimeters. Find the perimeter.

environ 5 ans il y a

A résolu


Find the hypotenuse
Given a and b (the two sides of a right-triangle), find c, the hypotenuse.

environ 5 ans il y a

A résolu


Calculate the area of a triangle between three points
Calculate the area of a triangle between three points: P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) these three points are the vert...

environ 5 ans il y a

A résolu


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

environ 5 ans il y a

A résolu


Derivative of polynomial
Compute the derivative of a given polynomial. The input is an <http://www.mathworks.com/help/matlab/math/representing-polynomial...

environ 5 ans il y a

A résolu


Matlab Basics - Assigning Variables
Assign different types of data to variables: integer, double, and strings Example: A is a double, for example 2.34 B is a...

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


Array of Ones
Create a 100 X 100 array of ones.

environ 5 ans il y a

A résolu


Positive Infinity
Round the array a towards positive infinity

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


Summation of array
Given an array, Find the sum of all of the elements in it Examples: Input x = [1 2 3 5; 4 5 6 7]; Output y is 33

environ 5 ans il y a

A résolu


Swap two numbers
Example Input: a = 10 b = 20 Output a = 20 b = 10

environ 5 ans il y a

Charger plus