Risolto


Volume and area of a sphere
Input(r) - radius Output([v,s]) - volume and area

circa 10 anni fa

Risolto


Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.

circa 10 anni fa

Risolto


Evaluating a polynomial
Given the following polynomial and the value for x, determine y. y = 3x^5 – x^3 + 8x – 3 Example x = 1 y = 3 - 1 +...

circa 10 anni fa

Risolto


Concatenating strings
* Write a statement that assigns fullName with firstName, a space, then lastName. Ex: If firstName is Alan and lastName is Tu...

circa 10 anni fa

Risolto


Transpose
Write a MATLAB script in order to convert a random length row vector (v) into a column vector.

circa 10 anni fa

Risolto


sum of first 'n' terms
Given n=10, find the sum of first 'n' terms Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...

circa 10 anni fa

Risolto


Complex number
For complex number c=a+bi, write code that will add a and b together.

circa 10 anni fa

Risolto


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

circa 10 anni fa

Risolto


Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

circa 10 anni fa

Risolto


Angle between two vectors
You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

circa 10 anni fa

Risolto


Which quadrant?
Given a complex number, output quadrant 'I' 'II' 'III' or 'IV' | II | I | ...

circa 10 anni fa

Risolto


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x=123045; x_vec=[1 2 3 0 4 5]; I happened upon a trick to do ...

circa 10 anni fa

Risolto


Sum the numbers on the main diagonal
Sum the numbers on the main diagonal of an n-by-n matrix. For input: A = [1 2 4 3 6 2 2 4 7]...

circa 10 anni fa

Risolto


Nth root.
* Assign outValues with the nth root of the inValues, the root is specified by rootValue

circa 10 anni fa

Risolto


Multiple element-wise operations: Percent change
Row arrays sales2013 and sales2014 reflect the quarterly sales (in millions) of a popular potato chip company. Write a statement...

circa 10 anni fa

Risolto


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

circa 10 anni fa

Risolto


Do you like your boss?
Do you like your boss? Answer can be any string! For example: Boss = 'Do you like your boss?'; Output = 'yes' or ...

circa 10 anni fa

Risolto


Cannon Ball
Given g (acceleration due to gravity) and desired altitude x, find the minimum ground velocity of a cannon ball to reach x.

circa 10 anni fa

Risolto


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

circa 10 anni fa

Risolto


Half?
If you toss an even number (x) of coins, what is the probability (y) of 50% head and 50% tail?

circa 10 anni fa

Risolto


The sum of the numbers in the vector
eg. [1,2,3]---->SUM=6

circa 10 anni fa

Risolto


Find out missing number from a vector of 9 elements
You are given a vector of size 9, x = [x1 x2 x3 x4 x5 x6 x7 x8 x9] Elements of x may be randomly selected without repeati...

circa 10 anni fa

Risolto


vectorization in N
For a given integer n (n>1), compute the sum f (i) (1 <= i <= n) where f (i) = 1 if n is odd and 2 otherwise.

circa 10 anni fa

Risolto


Generate a NaN...on purpose
The goal is to create a function that will return a single "NaN" without using the nan function. I am interested to see how many...

circa 10 anni fa

Risolto


Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

circa 10 anni fa

Risolto


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

circa 10 anni fa

Risolto


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

circa 10 anni fa

Risolto


Geometric series
Find the sum, given the first term t1, the common ratio r, and number of terms n. Examples If input t1=1, r=1, n=7 the...

circa 10 anni fa

Risolto


Remainder
Make 'y' equal to the remainder of 27 divided by 5. When x=27 and t=5

circa 10 anni fa

Risolto


Basics: 'Find the eigenvalues of given matrix
Find the eigenvalues y for a given matrix x.

circa 10 anni fa

Carica altro