Lecturer,EEE,BUBT

Solved

Twins in a Window

<http://en.wikipedia.org/wiki/Twin_primes Twin primes> are prime numbers that differ by 2, such as [11,13] or [41,43]. Write a f...

6 hours ago

Solved

How many jokers?

* Given DNA codes of a group of suspects, * and a code for certain types of jokers, * Count how many jokers of that type. * ...

6 hours ago

Solved

Remove the positive integers.

Given array,x, remove all the positive numbers and display ouput as y. Example x=[1 -2 3 -4] , output is y=[-2 -4].

6 hours ago

Solved

5 Prime Numbers

Your function will be given lower and upper integer bounds. Your task is to return a vector containing the first five prime numb...

6 hours ago

Solved

Divisible by 8

Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

7 hours ago

Solved

Divisible by 9

Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

7 hours ago

Solved

Divisible by 10

Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

8 hours ago

Solved

How many Integers?

Count the integers in a given vector |v|. You *must* use a loop to count each element separately. Examples: Input: v...

8 hours ago

Solved

Tax Calculator

Calculate the tax for a given income. 10% tax is paid for any income up to $2,000. 20% tax is paid for additional income u...

8 hours ago

Solved

Find the elements of a matrix according to a defined property.

From A = [5,2,3] and B = [1,2,3,4,5,6,7,8,9,10] produce a vector C where : C(1) is the sum of the first A(1) elements of B, ...

17 hours ago

Solved

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

17 hours ago

Solved

Matrix which contains the values of an other matrix A at the given locations.

If you have two matrices, which together give xc and yc coordinates into another matrix, eg : xc = [1 1 1; 2 2 1]; ...

18 hours ago

Solved

Convert yards to feet

The goal of this script is to convert a value given in yards to feet.

18 hours ago

Solved

07 - Common functions and indexing 1

Define _cMat_: <<http://samle.dk/STTBDP/Assignment1_3c.png>> ( _cMat_ = 10x10 matrix where the numbers from 1 to 100 runs ...

19 hours ago

Solved

07 - Common functions and indexing 5

Create the vector _lin_: <<http://samle.dk/STTBDP/Assignment1_7e.png>> (the integers from 1 to 20) Make every other val...

19 hours ago

Solved

Sort numbers by outside digits

Sort the array so that they are sorted as if their value was a 5 digit number made from the first three and last two digits of t...

1 day ago

Solved

union without repitition

Let a = [9 9 9 9 9 9 8 8 8 8 7 7 7 6 6 6 5 5 4 2 1] b = [1 1 1 3 3 3 3 3 4 4 4 4 4 10 10 10] Output should be [9 8...

1 day ago

Solved

07 - Common functions and indexing 6

Create a variable _m_ as a magic square with the size 6 x 6 Magic squares are defined as square matrices, where the sum of a...

1 day ago

Solved

Solve the set of simultaneous linear equations

Given this pair of simultaneous linear equations: 2x + 3y = 23 3x + 4y = 32 Find the solution set (x,y)

1 day ago

Solved

execute the declaration in strings and return value

execute the commands in strings and return value input='a=23' output=23

1 day ago

Solved

most frequent character

Obtain the most frequent character. For example, s='balaram'; output='a'; If there is a tie between letters, return t...

1 day ago

Solved

interesting center of magic matrix

output the centre of magic matrix of n input=7; output=25

1 day ago

Solved

Back to basics 15 - Benchmark

Covering some basic topics I haven't seen elsewhere on Cody. Return an array of the benchmark values for MATLAB.

1 day ago

Solved

Construct an index vector from two input vectors in vectorized fashion

Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

1 day ago

Solved

Colon operator of two vectors

You are given two vectors of equal length: VecStart, VecEnd Each vector contain a set of integers, where VecEnd(j)>=VecStar...

1 day ago

Solved

index of n^2 in magic(n)

input=5 magic matrix 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 ...

1 day ago

Solved

Find the index of n in magic(n)

If input n=5, then magic(n) is 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22...

1 day ago

Solved

Carnot cycle

Carnot engine is considered the most efficient heat engine.When operated between two temperatures T1 and T2, the efficiency is g...

1 day ago