Gelöst


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

4 Monate vor

Gelöst


Maximum running product for a string of numbers
Given a string s representing a list of numbers, find the five consecutive numbers that multiply to form the largest number. Spe...

4 Monate vor

Gelöst


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displayed ...

4 Monate vor

Gelöst


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

4 Monate vor

Gelöst


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

4 Monate vor

Gelöst


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

4 Monate vor

Gelöst


The Goldbach Conjecture, Part 2
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

4 Monate vor

Gelöst


Draw a '5' in a zero matrix!

4 Monate vor

Gelöst


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

4 Monate vor

Gelöst


Minimum possible M of the maximum side of a triangle of given area A.
Suppose a triangle has area A. Suppose it has three sides S1, S2, and S3. Suppose M = max([S1 S2 S3]). What is the minimum po...

4 Monate vor

Gelöst


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

4 Monate vor

Gelöst


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

4 Monate vor

Gelöst


Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

4 Monate vor

Gelöst


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

4 Monate vor

Gelöst


Identify de Polignac numbers
The numbers 125 and 329 can be written as the sum of a prime and a power of 2. For example, , and . The numbers 127 and 331, whi...

4 Monate vor

Gelöst


Convert a numerical matrix into a cell array of strings
Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

4 Monate vor

Gelöst


String Logic 18
Examples: 'DIG' --> 'DG' 'IMPORTANT' --> 'IPRAT' 'DEAL' --> 'DA' 'LIMB' --> 'LM' 'MOSTLY' --> 'MSL'

4 Monate vor

Gelöst


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 to use d...

4 Monate vor

Gelöst


Battery Charge Efficiency Calculation
In a Battery Management System (BMS), the efficiency of battery charging can be estimated using the formula: where: is the...

4 Monate vor

Gelöst


How to calculate the length of a triangle's side given two angles and one side
You are given a triangle with angles alpha, beta and gamma and sides a opposite alpha, b opposite beta and c opposite gamma. ...

4 Monate vor

Gelöst


Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

4 Monate vor

Gelöst


MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

4 Monate vor

Gelöst


Create a vector
Create a vector from 0 to n by intervals of 2.

4 Monate vor

Gelöst


Convert a Cell Array into an Array
Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

4 Monate vor

Gelöst


Cos Function
x is the abscissa. find the absolute value of cosine of -x and the same value with changed sign.

4 Monate vor

Gelöst


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

4 Monate vor

Gelöst


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

4 Monate vor

Gelöst


Solve for factorial of X
It gives you the number x, and set y equal to x factorial. Ex. There are 52 cards in a deck, each specific order of all 52 car...

4 Monate vor

Gelöst


Return area of square
Side of square=input=a Area=output=b

4 Monate vor

Gelöst


Multiplying the Sums of Two Arrays
Get two arrays, add the values within the array up, and then multiply the two total values. [2,3]*[3,6] 5*18 90

4 Monate vor

Mehr laden