Solved


Tic Tac Toe FTW
Given a tic tac toe board: * 1 represents X * 0 represents empty. * -1 represents O It is X's move. If there is an imme...

ungefär 2 år ago

Solved


Guess Cipher
Guess the formula to transform strings as follows: 'Hello World!' --> 'Ifmmp Xpsme!' 'Can I help you?' --> 'Dbo J ifm...

ungefär 2 år ago

Solved


Find the area of the four walls
If length, breadth and height of the walls are given, find the area of the four walls.

ungefär 2 år ago

Solved


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

ungefär 2 år ago

Solved


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 same order a...

ungefär 2 år ago

Solved


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

ungefär 2 år ago

Solved


Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...

ungefär 2 år ago

Solved


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

ungefär 2 år ago

Solved


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

ungefär 2 år ago

Solved


matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...

ungefär 2 år ago

Solved


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...

ungefär 2 år ago

Solved


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

ungefär 2 år ago

Solved


Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

ungefär 2 år ago

Solved


reverse string
input='rama' output='amar'

ungefär 2 år ago

Solved


Create sequnce 1 4 9 16 25.........
Create sequnce 1 4 9 16 25......... upto entered input value using matlab scripting commands. Let y be output and x be input

ungefär 2 år ago

Solved


Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

ungefär 2 år ago

Solved


Reverse Calculator
Use this reverse calculator and give correct output Its simple, In my Reverse calculator if you press 0 it will be considered...

ungefär 2 år ago

Solved


Make a simplified barcode
Given an integer to encode, make a barcode using the following encoding scheme: * The bar code is made from the binary versio...

ungefär 2 år ago

Solved


03 - Matrix Variables 6
Make _fMat_ be a 5x3 matrix of random integers with values from -3 to 3 (Hint: use *randi*)

ungefär 2 år ago

Solved


Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

ungefär 2 år ago

Solved


02 - Vector Variables 5
_eVec_ = _Hello_ ( _eVec_ is a string, which is a vector of characters )

ungefär 2 år ago

Solved


Replace every 3rd element in a vector with 4
x is a vector of undetermined length You are to replace every 3rd element with the number 4, example: x = [11 23 34 43 2 3...

ungefär 2 år ago

Solved


03 - Matrix Variables 3
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3c.png>> A 10x10 matrix where the numbers from 1 to 100 ...

ungefär 2 år ago

Solved


Largest Twin Primes
<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...

ungefär 2 år ago

Solved


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

ungefär 2 år ago

Solved


Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

ungefär 2 år ago

Solved


05 - Vector Equations 1
Define the vector _cVec_: <<http://samle.dk/STTBDP/Assignment1_2c.png>> (all the numbers from 5 to -5 in increments of -0....

ungefär 2 år ago

Solved


Is the Point in a Circle?
Check whether a point or multiple points is/are in a circle centered at point (x0, y0) with radius r. Points = [x, y]; c...

ungefär 2 år ago

Solved


Multiply 2 numbers
Very easy, you just have to multiply 2 numbers but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...

ungefär 2 år ago

Solved


Create an 'arrow-head" matrix
Write a function that when given an odd number, produces an arrow-head function pointing to the right. Examples n = 3 ...

ungefär 2 år ago

Load more