Create an index-powered vector
Given a input vector x, return y as index-powered vector as shown below.
Example
x = [2 3 6 9]
then y should be
[...
10ヶ月 前
解決済み
Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle.
<<https://i.imgu...
10ヶ月 前
解決済み
Datetime basics
Generate the datetime scalar representing the current date
10ヶ月 前
解決済み
Fibonacci sequence
Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Input...
10ヶ月 前
解決済み
XOR fibonacci
a & b are the first two terms in the xor fibonacci sequence. Find the nth term of that sequence.
XOR fib sequence is that in ...
First N Perfect Squares
*Description*
Return the first N perfect squares
*Example*
input = 4;
output = [ 1 4 9 16 ];
10ヶ月 前
解決済み
Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...
Binary Coder
Take an input number and print the binary value of this number.
10ヶ月 前
解決済み
Sum of Even Numbers in a Vector
Write a function that takes a vector x as input and returns the sum of all even numbers in x.
Input:
x = [1, 2, 3, 4, 5, 6] ...
Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if
list = {'Barney Google','Snuffy Smith','Dagwood ...
10ヶ月 前
解決済み
Find number of days
The input is two date in string format (dd-mm-yyyy)
find out the number of days between these two dates.
Example:
input: ...
10ヶ月 前
解決済み
What day is it?
Tell me what day is it. Return the full name of the day of the week as a string.
e.g. It's June 12th 2014, so your function s...
Reverse the vector
Reverse the vector elements.
Example:
Input x = [1,2,3,4,5,6,7,8,9]
Output y = [9,8,7,6,5,4,3,2,1]
10ヶ月 前
解決済み
Coin Distribution - 02
Prev prob <https://www.mathworks.com/matlabcentral/cody/problems/45385-coin-distribution>
Given a set of coins and an amount,...
Reverse the Words (not letters) of a String
*Description*
Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...