Solved

Getting the indices from a vector

This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

ongeveer 5 jaar ago

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

ongeveer 5 jaar ago

Solved

Back to basics 12 - Input Arguments

Covering some basic topics I haven't seen elsewhere on Cody. Return a value equal to the number of input arguments to the fun...

ongeveer 5 jaar ago

Solved

Back to basics 8 - Matrix Diagonals

Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

ongeveer 5 jaar ago

Solved

Add two numbers

Calculate the sum of two numbers. Example input = [2 3] output = 5

ongeveer 5 jaar 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...

ongeveer 5 jaar ago

Solved

Doubling elements in a vector

Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

ongeveer 5 jaar ago

Solved

Vector creation

Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

ongeveer 5 jaar ago

Solved

Flip the vector from right to left

Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

ongeveer 5 jaar ago

Solved

Squaring Matrix

Square the following matrix using matlab % A = 1 2 3 4 5 6 7 8 So new matrix should display...

ongeveer 5 jaar ago

Solved

Pizza!

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

ongeveer 5 jaar ago

Solved

Draw 'I'

Given n as input, draw a n-by-n matrix 'I' using 0 and 1. example: n=3 ans= [0 1 0 0 1 0 0 1 0] n=...

ongeveer 5 jaar ago

Solved

Draw 'J'

Given n as input, generate a n-by-n matrix 'J' using 0 and 1 . Example: n=5 ans= [0 0 0 0 1 0 0 0 0 1 0 0 ...

ongeveer 5 jaar ago

Solved

Area of an equilateral triangle

Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

ongeveer 5 jaar ago

Solved

Length of a short side

Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

ongeveer 5 jaar ago

Solved

Length of the hypotenuse

Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

ongeveer 5 jaar ago

Solved

Draw 'O' !

Given n as input, generate a n-by-n matrix 'O' using 0 and 1 . example: n=4 ans= [1 1 1 1 1 0 0 1 ...

ongeveer 5 jaar ago

Solved

Draw a 'N'!

Given n as input, generate a n-by-n matrix 'N' using 0 and 1 . Example: n=5 ans= [1 0 0 0 1 1 1 0 0 1 1 0 ...

ongeveer 5 jaar ago

Solved

Draw a 'Z'.

Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ . Example: n=5 ans= [1 1 1 1 1 0 0 0 1 ...

ongeveer 5 jaar ago

Solved

Draw 'H'

Draw a x-by-x matrix 'H' using 1 and 0. (x is odd and bigger than 2) Example: x=5 ans= [1 0 0 0 1 1 0 0 0 1 ...

ongeveer 5 jaar ago

Solved

Draw 'F'

Draw a x-by-x matrix 'F' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

ongeveer 5 jaar ago

Solved

Draw 'E'

Draw a x-by-x matrix 'E' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

ongeveer 5 jaar ago

Solved

Draw 'B'

Draw a x-by-x matrix 'B' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 0 1 0 0 0 1 ...

ongeveer 5 jaar ago

Solved

Draw 'D'.

Draw a x-by-x matrix 'D' using 0 and 1. example: x=4 ans= [1 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0]

ongeveer 5 jaar ago

Solved

Draw 'C'.

Given x as input, generate a x-by-x matrix 'C' using 0 and 1. example: x=4 ans= [0 1 1 1 1 0 0 0 ...

ongeveer 5 jaar ago

Solved

Sum all integers from 1 to 2^n

Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

ongeveer 5 jaar ago

Solved

Finding Perfect Squares

Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

ongeveer 5 jaar ago