Solved

Energy of an object

Calculate the total mechanical energy of an object. Total Energy= Potential energy + Kinetic energy P.E.=m*g*h K.E.=1/2...

2 years ago

Solved

Display negative numbers

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

2 years ago

Solved

Create a constant offset.

Add a constant offset to an array. Example a = [1 3 5 9] offset = 2 y = [3 5 7 11]

2 years ago

Solved

subtract central cross

Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

2 years ago

Solved

Cos Function

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

2 years ago

Solved

Area of polygon

Given the vertices in vectors X,Y, return the area of the polygon they define.

2 years ago

Solved

Simple polynomial evaluation

Compute the value of a polynomial of degree n with all coefficients '1', at value x. n is always n>=0. p(x)=1+x+x^2+...+x^n...

2 years ago

Solved

Polynomial evaluation

Compute the value of a polynomial of degree n with coeffcients in vector a, at value x. p(x)=a(1)+a(2)x+a(3)x^2+...+a(n+1)x...

2 years ago

Solved

Alternate elements!

Write a function that combines two lists by alternating the elements, e.g. ['a','b','c'], ['1','2','3'] → 'a1b2c3'.

2 years ago

Solved

Duplicate each element of a vector.

for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

2 years ago

Solved

Draw a x-by-x matrix 'Denmark flag'(Euro(2020)

Draw a x-by-x matrix 'Denmark flag' using '4' and '1'.(x is odd and bigger than 4) Number 4: Caption S.Kjær and number 1: K.S...

2 years ago

Solved

Draw matrix 'Swiss flag'( Euro 2020)

Draw a x-by-x matrix 'Swiss flag' using '0' and '1'.(x is odd and bigger than 4) Example x=5 ...

2 years ago

Solved

convert between ascii and characters

I have seen multiple problems like this but none of them have a robust test suite associated with them. The first input C is ...

2 years ago

Solved

Add consecutive integer numbers

Given consecutive numbers, add the numbers *without using the sum command in MATLAB.*

2 years ago

Solved

How long does it take to run a bath?

Given the *volume flow rate* (volume/time) of a faucet and the *volume* of a bath tub, find the amount of time it takes to fill ...

2 years ago

Solved

Area of a pentagon

Given the side of a regular pentagon and its apothem return the area of pentagon. Remember the area of pentagon is calculate ...

2 years ago

Solved

How many complete pizzas

x is a vector with numbers of pizza slices. A corresponding vector n indicates in how many slices the pizza slices of x were cut...

2 years ago

Solved

Binary Inversion

Given the unsigned 8-bit integer x, return the number y which is the binary inversion of x. For example if x is 5, y should b...

2 years ago

Solved

Count the numbers

In a array x, count the number of times the number n appears in x. for example: x = [1 2 3 4 3 2 1 2] and n = 2 the answer sh...

2 years ago

Solved

All odd - all even

All odd numbers in x are added, while all even numers are subtracted from this. example: x = [1 2 3 4 5]; y = +(1+3+5)-...

2 years ago

Solved

sum of ASCII

Given a string x, return the sum of all ASCII numbers of all characters. for example, if x='lala' ('l'-> 108, 'a'->97) then y...

2 years ago

Solved

Add the even numbers

Add only the even numbers of x example: x = [1 2 3 4 5] the positive numbers are: 2 4, so their sum is 6

2 years ago

Solved

Second smallest number

What is the second smallest number in x? example: x = [1 2 3 4 5 6 7 8 9] y = 2

2 years ago

Solved

Odd times even numbers in a matrix

First count the number of odd numbers in x, then the number of even. Return their product. example: x = [1 2] One odd ...

2 years ago

Solved

Finding sum of even numbers in a vector.

Find the sum of all the even numbers present in the input vector x. Examples: Input x = [1 2 3 4] Output y is 6 Input...

2 years ago

Solved

Project Euler: Problem 1, Multiples of 3 and 5

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

2 years ago