A résolu


Portfolio diversification: choose your stocks !
we have the returns of 3 stocks for the last 4 years and we have to combine only 2 stocks that are less correlated. Example: ...

plus de 5 ans il y a

A résolu


remove every row&col for every nan
for a given matrix, remove the row and column of every nan. Example x=[1 2 NaN 4 5 6 7 8 ...

plus de 5 ans il y a

A résolu


continuous compounding
what's the present value of having 100 dollars after n years given a continuously compounded rate i ? keep only 2 decimals pleas...

plus de 5 ans il y a

A résolu


Writing Error Messages
Well written functions check inputs to make sure the input is valid. The function ErrorCheck takes three arguments: * a - a s...

plus de 5 ans il y a

A résolu


Tax Calculator
Calculate the tax for a given income. 10% tax is paid for any income up to $2,000. 20% tax is paid for additional income u...

plus de 5 ans il y a

A résolu


Add a vector to a matrix
Given a matrix |mat| of size |mXn| and a row vector |v| of size |1Xs|, return a matrix with |m+1| rows that conatains |mat| over...

plus de 5 ans il y a

A résolu


Moving Median Absolute Deviation
The median absolute deviation (MAD) is defined as MAD = median(abs(A − median(A))) for a rolling window of length n. For...

plus de 5 ans il y a

A résolu


Sum of combinations
Input: *X = 40*, *Y = [40 20 10 4]* Output: *Z = [1 0 0 0; 0 2 0 0; 0 1 2 0; 0 1 1 3; 0 1 0 5; 0 0 4 0; 0 0 3 3; 0 0 2 5; 0 ...

plus de 5 ans il y a

A résolu


The twelve days of Christmas
Traditionally there are twelve days of Christmas to celebrate ("Twelvetide"), typically starting with Christmas Day (25 December...

plus de 5 ans il y a

A résolu


How many unique Pythagorean triples?
For a given integer |n|, return all <https://en.wikipedia.org/wiki/Pythagorean_triple Pythagorean triples> that inlude numbers s...

plus de 5 ans il y a

A résolu


Exponential decay
Many dynamic processes can be approximated as an exponential decay. This applies to radioactive decay, some chemical reactions, ...

plus de 5 ans il y a

A résolu


Friday or not
I love Friday. Please tell me whether the day is Friday. Dateformat is 'yyyy-mm-dd' or 'dd-mmm-yyyy' or 'mm/dd/yyyy'. Exa...

plus de 5 ans il y a

A résolu


Calculate the CIRCUMFERENCE of circle.
Given the radius is 2, the circumference will be 12.5663.

plus de 5 ans il y a

A résolu


Separate even from odd numbers in a vector - with a loop
*Using a loop*, rearrange a vector of integers such that the odd numbers appear at the beginning, and even numbers at the end. T...

plus de 5 ans il y a

A résolu


Shuffle
Shuffle a vector by breaking it up to segments of |n| elements, and rearranging them in a reversed order. For example, the ve...

plus de 5 ans il y a

A résolu


Approximate the cosine function
Without using MATLAB trigonometric functions, calculate the cosine of an argument |x| to a precision of |0.0001| *Hint:* You ...

plus de 5 ans il y a

A résolu


Capitilize the first letter of every word in a string
For a given input string, capitalize every letter at the beginning of a word, and transform the rest of the letters to lower-cas...

plus de 5 ans il y a

A résolu


Get a new matrix by mapping each element of an arbitrary-sized input matrix using lookup table
A is a matrix of any size and dimension. Each element of matrix A belongs to the set S of natural numbers up to N. B is a vector...

plus de 5 ans il y a

A résolu


Find the repeating elements and repetitions of a row vector.
So let's say that x is a vector, for example, x = [4, 4, 5, 5, 5, 6, 7, 7,8, 8, 8, 8] Now we want to get the following two ve...

plus de 5 ans il y a

A résolu


Normie Function
So, I built a function and gave it a name- _Normie_. *Find the nth term of Normie function:* _f(n)= 1*f(n-1)+ 2*f(n-3)+ 3_ , *...

plus de 5 ans il y a

A résolu


Normie Function (2)
Another _Normie Function_ defined as _f(n)= f(n-1)+f(n-2)+f(n-3)_ , *when n>3* and _1_ , *when n<=3*. *Find the nth term of this...

plus de 5 ans il y a

A résolu


¿Es una parábola?
Dados los datos de las magnitudes _*x*_ e _*y*_, crear una función que permita conocer si se trata de una parábola o no, indican...

plus de 5 ans il y a

A résolu


¡Puntos de corte!
Crea una función que permita calcular los puntos de corte con los ejes X e Y de una función cuadrática indicada por el usuario e...

plus de 5 ans il y a

A résolu


¿Es una función exponencial?
Crea una función que permita analizar si los datos dados por el usuario ( *x* e *y*) se relacionan por medio de una función expo...

plus de 5 ans il y a

A résolu


Day counter function
Write a function called _day_counter_ that returns the number of Mondays that fell on the first day of the month in a given year...

plus de 5 ans il y a

A résolu


Second Diagonal
Transpose the matrix from it's second diagonal.

plus de 5 ans il y a

A résolu


Find prime number couples
Given a vector a, which will always contain at least one pair of prime numbers couple, return a matrix called 'couple' in which ...

plus de 5 ans il y a

A résolu


Calculate time taken by light to reach earth surface
We know the time(seconds) taken by light to reach surface of earth. What if the distance varies yearly or source of light moves ...

plus de 5 ans il y a

A résolu


Numbers on 7-segment
This is a 7-segment: _ |_| |_| It's a 3-by-3 char matrix.It has made by 3 characters: '_' , '|' and ' ' (space...

plus de 5 ans il y a

A résolu


Prime Product
My professor has given a sequence of N numbers as a1, a2, ..., aN and asked me to find the smallest possible value of ai * aj su...

plus de 5 ans il y a

Charger plus