Solved

Is this triangle right-angled?

Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

6 mois ago

Solved

Sum the 'edge' values of a matrix

Sum the 'edge' values of an input matrix (the values along the perimeter). Example [1 2 3 4 5 6 7 8 9] Output = ...

6 mois ago

Solved

Matlab Basics - Set unwanted parts of a vector to zero

Consider a vector x, of length >= 7, write a script to set elements 2, 5, and 6 to zero. Example x = [1 2 3 4 5 6 7] --> ...

6 mois ago

Solved

Side of an equilateral triangle

If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

6 mois ago

Solved

Basic arrays operations.

Apply element-by-element binary operation 'fun' to two arrays (A and B).

6 mois ago

Solved

Square the input

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

6 mois ago

Solved

Cumulative product of a vector

Cumulative product of a vector example x=[1 2 5 10], then answer must be [ 1 2 10 100] *If you like this prob...

6 mois ago

Solved

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

6 mois ago

Solved

Find the product of a Vector

How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?; x = [1 : 0.5 : 6]; y ...

6 mois ago

Solved

If-then-else

Complete the function below such that if the value of x is in the range 10 to 14, inclusive, the value 18 is assigned to y. Oth...

6 mois ago

Solved

Find the largest number

Given a vector v with 4 elements, find the largest number x. Example: Input: v = [4 7 1 6]; Output: x = 7; You mu...

6 mois 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)

6 mois ago

Solved

Find the area of a triangle

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

6 mois ago

Solved

BASICS - sum part of vector

Please make a function, where as input you get vector "x" and and vector "c", where in "c" vector you get indexes to sum. Examp...

6 mois ago

Solved

Matlab Basics II - Count rows in a matrix

Write a function that returns that number of rows in a vector or matrix x example: x = [1; 2; 3] output = 3

6 mois ago

Solved

Do Fast Fourier Transformation

Example Fast Fourier Transformation from vector [2,1]) ans = 3 1

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

6 mois ago

Solved

Matlab Basics II - Intervals

Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

6 mois ago

Solved

Return the largest number that is adjacent to a zero

This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

6 mois ago

Solved

Back to basics 11 - Max Integer

Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

6 mois ago

Solved

Create incrementing array

Given a and b generate an output matrix as shown in following examples: a=2 b=5 output=[2 20 200 2000 20000] a=4 b...

6 mois ago

Solved

Find the logic

There exists one logic in between input and output. Find it (easy math). Example 1: x=13 then y=339; Example 2: x=26...

6 mois ago