Get an array of month-ends in a date range
Create a function that would return a list of month-ends falling in a given date range.
If a start date or end date falls on a...
5年以上 前
解決済み
Rotate Matrix @180 degree
Rotate Matrix @180 degree
Example
A=[8 1 6; 3 5 7; 4 9 2], then answer would be
[2 9 4;...
Find the hypotenuse
Given a and b (the two sides of a right-triangle), find c, the hypotenuse.
5年以上 前
解決済み
only input
Return the output without writing any code into the function.
5年以上 前
解決済み
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 ...
5年以上 前
解決済み
Duplicate a character
Duplicate a character 'n' times.
Example 1: str='a' n=5
output='aaaaa'
Example 2: str='*' n=3
output='***'
5年以上 前
解決済み
Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times.
Examples
n=2, A=[1 2 3] -> [1 1 2 2 3 3]
...
5年以上 前
解決済み
weekday and month
Given a year and a weekday, determine how many months of that year had five of those weekdays. It is kind of easy to find.
Ex...
5年以上 前
解決済み
Tax Season ! How much is my salary?
Tax Season! I was employed for a period from x until y in a year and I get pay check of amount z on every alternate Friday of th...
Beginner's Problem - Squaring
Try out this test problem first.
Given the variable x as your input, square it by two and put the result in y.
Examples:
...
5年以上 前
解決済み
Datetime basics
Generate the datetime scalar representing the current date
5年以上 前
解決済み
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...
5年以上 前
解決済み
How Many Months Until It's Today Again?
Given a particular date, calculate how many months must pass before that same day of the month occurs on the same day of the wee...